use data.snippet in completions for snippet insertion
This commit is contained in:
parent
d276f10bcd
commit
7ce86e24f1
2 changed files with 6 additions and 5 deletions
|
|
@ -137,14 +137,15 @@ var Autocomplete = function() {
|
|||
if (data.completer && data.completer.insertMatch) {
|
||||
data.completer.insertMatch(this.editor);
|
||||
} else {
|
||||
if (data.value)
|
||||
data = data.value;
|
||||
if (this.completions.filterText) {
|
||||
var range = this.editor.selection.getRange();
|
||||
range.start.column -= this.completions.filterText.length;
|
||||
this.editor.session.remove(range);
|
||||
}
|
||||
snippetManager.insertSnippet(this.editor, data);
|
||||
if (data.snippet)
|
||||
snippetManager.insertSnippet(this.editor, data.snippet);
|
||||
else
|
||||
this.editor.insert(data.value || data);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ var snippetCompleter = {
|
|||
if (s.tabTrigger && s.tabTrigger.indexOf(prefix) === 0)
|
||||
completions.push({
|
||||
caption: s.tabTrigger,
|
||||
value: s.content,
|
||||
meta: 'snippet'
|
||||
snippet: s.content,
|
||||
meta: "snippet"
|
||||
});
|
||||
}
|
||||
}, this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue