Don't autoInsert with auto magic completer

This caused completions to be inserted without ever being shown, if
they were the only completion for the prefix entered.
This commit is contained in:
Aaron O'Mullan 2014-01-28 02:14:23 +01:00
commit c4012ebd46

View file

@ -145,7 +145,18 @@ var onChangeAutocomplete = function(e, editor) {
// Only autocomplete if there's a prefix that can be matched
if(prefix !== '' && !(hasCompleter)) {
Autocomplete.startCommand.exec(editor);
if (!editor.completer) {
// Create new autocompleter
editor.completer = new Autocomplete();
// Disable autoInsert
editor.completer.autoInsert = false;
}
editor.completer.showPopup(editor);
// needed for firefox on mac
editor.completer.cancelContextMenu();
} else if(prefix === '' && hasCompleter) {
// When the prefix is empty
// close the autocomplete dialog