Insert completion at each cursor
This commit is contained in:
parent
8cb5b1f0e9
commit
bde1acec75
1 changed files with 6 additions and 4 deletions
|
|
@ -138,14 +138,16 @@ var Autocomplete = function() {
|
|||
data.completer.insertMatch(this.editor);
|
||||
} else {
|
||||
if (this.completions.filterText) {
|
||||
var range = this.editor.selection.getRange();
|
||||
range.start.column -= this.completions.filterText.length;
|
||||
this.editor.session.remove(range);
|
||||
var ranges = this.editor.selection.getAllRanges();
|
||||
for (var i = 0, range; range = ranges[i]; i++) {
|
||||
range.start.column -= this.completions.filterText.length;
|
||||
this.editor.session.remove(range);
|
||||
}
|
||||
}
|
||||
if (data.snippet)
|
||||
snippetManager.insertSnippet(this.editor, data.snippet);
|
||||
else
|
||||
this.editor.insert(data.value || data);
|
||||
this.editor.execCommand("insertstring", data.value || data);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue