This commit is contained in:
nightwing 2014-03-23 15:19:24 +04:00
commit 79f619364a
2 changed files with 4 additions and 8 deletions

View file

@ -181,11 +181,9 @@ var Autocomplete = function() {
"Esc": function(editor) { editor.completer.detach(); }, "Esc": function(editor) { editor.completer.detach(); },
"Space": function(editor) { editor.completer.detach(); editor.insert(" ");}, "Space": function(editor) { editor.completer.detach(); editor.insert(" ");},
"Return": function(editor) { "Return": function(editor) {
if (editor.completer.popup.getRow() > -1) { if (editor.completer.popup.getRow() == -1)
editor.completer.insertMatch(); return false;
} else { editor.completer.insertMatch();
editor.insert("\n");
}
}, },
"Shift-Return": function(editor) { editor.completer.insertMatch(true); }, "Shift-Return": function(editor) { editor.completer.insertMatch(true); },
"Tab": function(editor) { editor.completer.insertMatch(); }, "Tab": function(editor) { editor.completer.insertMatch(); },
@ -290,8 +288,7 @@ var Autocomplete = function() {
return doDetach(); return doDetach();
// Wrong prefix or wrong session -> ignore // Wrong prefix or wrong session -> ignore
if (prefix.indexOf(results.prefix) != 0 if (prefix.indexOf(results.prefix) != 0 || _id != this.gatherCompletionsId)
|| _id != this.gatherCompletionsId)
return; return;
this.completions = new FilteredList(matches); this.completions = new FilteredList(matches);

View file

@ -114,7 +114,6 @@ var Tokenizer = function(rules) {
// makes property access faster // makes property access faster
if (!rule.onMatch) if (!rule.onMatch)
rule.onMatch = null; rule.onMatch = null;
rule.__proto__ = null;
} }
splitterRurles.forEach(function(rule) { splitterRurles.forEach(function(rule) {