Update regex and condition check according to suggestion

This commit is contained in:
Homa Wong 2014-05-04 09:45:12 -07:00
commit 8018756051
2 changed files with 3 additions and 11 deletions

View file

@ -45,7 +45,7 @@ exports.parForEach = function(array, fn, callback) {
} }
}; };
var ID_REGEX = /[a-zA-Z_0-9\$-]|[^\u0000-\u007F]/; var ID_REGEX = /[a-zA-Z_0-9\$-\u007F-\uFFFF]/;
exports.retrievePrecedingIdentifier = function(text, pos, regex) { exports.retrievePrecedingIdentifier = function(text, pos, regex) {
regex = regex || ID_REGEX; regex = regex || ID_REGEX;

View file

@ -168,11 +168,7 @@ require("../config").defineOptions(Editor.prototype, "editor", {
enableBasicAutocompletion: { enableBasicAutocompletion: {
set: function(val) { set: function(val) {
if (val) { if (val) {
if (Array.isArray(val)) { this.completers = Array.isArray(val)? val: completers;
completers = val;
}
this.completers = completers;
this.commands.addCommand(Autocomplete.startCommand); this.commands.addCommand(Autocomplete.startCommand);
} else { } else {
this.commands.removeCommand(Autocomplete.startCommand); this.commands.removeCommand(Autocomplete.startCommand);
@ -188,11 +184,7 @@ require("../config").defineOptions(Editor.prototype, "editor", {
enableLiveAutocompletion: { enableLiveAutocompletion: {
set: function(val) { set: function(val) {
if (val) { if (val) {
if (Array.isArray(val)) { this.completers = Array.isArray(val)? val: completers;
completers = val;
}
this.completers = completers;
// On each change automatically trigger the autocomplete // On each change automatically trigger the autocomplete
this.completers = completers; this.completers = completers;