mycodemirror
Advanced tools
Comparing version 5.19.6 to 5.19.7
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2204896
50676