Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mycodemirror

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mycodemirror - npm Package Compare versions

Comparing version 5.19.6 to 5.19.7

25

addon/hint/sql-hint.js

@@ -292,5 +292,3 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others

var val = editor.getLine(line);
var frontKey = val.slice(ch - 6 ,ch).toUpperCase();
var frontKey1 = val.slice(ch - 5 ,ch).toUpperCase();
if ( test(frontKey,'FROM',ch,5) || test(frontKey1,'FROM',ch,5) || test(frontKey,'JOIN',ch,5) || test(frontKey1,'JOIN',ch,5) || test(frontKey,'TABLE',ch,6) || test(frontKey1,'TABLE',ch,6) ) {
if ( check('FROM',val,ch) || check('JOIN',val,ch) || check('TABLE',val,ch) ) {
addMatches(result, search, table, function (w) {

@@ -309,9 +307,22 @@ return w;

}
function check(key,val,ch){
//判断当前的长度
//情况
// 1 :from {提示表格} key = val.slice(ch - from.length - 1 ,ch).toUpperCase(); key = 'FROM '
// 2 : from {提示表格} key = val.slice(ch - from.length - 2 ,ch).toUpperCase(); key = ' FROM '
// 3 : /rfrom {提示表格}key = val.slice(ch - from.length - 2 ,ch).toUpperCase(); key = '/rFROM '
// 4 : /r from {提示表格} key = val.slice(ch - from.length - 2 ,ch).toUpperCase(); key = ' FROM '
var frontKey = val.slice(ch - key.length - 2 ,ch).toUpperCase();
var frontKey1 = val.slice(ch - key.length - 1 ,ch).toUpperCase();
if(frontKey === ' ' + key + ' ' ||frontKey === '\n' + key + ' '|| frontKey === '\r' + key + ' ' ){
//第一种情况
return true;
}
//第一行第一个
if(ch === (key.length + 1)&& frontKey1 === key + ' ' ){
function test(key,test,ch,len){
if(key === ' ' + test + ' '|| (ch === len )&&key == test + ' ' || key =='\n' + key || key === '\r' + test){
return true;
}else{
return false;
}
return false;
}

@@ -318,0 +329,0 @@

{
"name": "mycodemirror",
"version": "5.19.6",
"version": "5.19.7",
"main": "lib/codemirror.js",

@@ -5,0 +5,0 @@ "description": "Full-featured in-browser code editor",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc