Fixes asynchronous autocompleter prefix updating

Before it could happen (if an async autocompleter returned late) that
the prefix used in the autocomplete was out of date. This fixes that.
This commit is contained in:
Zef Hemel 2014-03-20 15:27:51 +01:00
commit 31a32f2659

View file

@ -197,8 +197,11 @@ var Autocomplete = function() {
next(); next();
}); });
}, function() { }, function() {
// Fetch prefix again, because they may have changed by now
var pos = editor.getCursorPosition();
var line = session.getLine(pos.row);
callback(null, { callback(null, {
prefix: prefix, prefix: util.retrievePrecedingIdentifier(line, pos.column),
matches: matches matches: matches
}); });
}); });