[Autocomplete] fix insertion of words containing - sign
This commit is contained in:
parent
3026d78395
commit
f82c4df96a
2 changed files with 19 additions and 16 deletions
|
|
@ -138,8 +138,11 @@ var Autocomplete = function() {
|
||||||
} else {
|
} else {
|
||||||
if (data.value)
|
if (data.value)
|
||||||
data = data.value;
|
data = data.value;
|
||||||
if (this.completions.filterText)
|
if (this.completions.filterText) {
|
||||||
this.editor.removeWordLeft();
|
var range = this.editor.selection.getRange();
|
||||||
|
range.start.column -= this.completions.filterText.length;
|
||||||
|
this.editor.session.remove(range);
|
||||||
|
}
|
||||||
this.editor.insert(data);
|
this.editor.insert(data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ exports.parForEach = function(array, fn, callback) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ID_REGEX = /[a-zA-Z_0-9\$]/;
|
var ID_REGEX = /[a-zA-Z_0-9\$-]/;
|
||||||
|
|
||||||
exports.retrievePrecedingIdentifier = function(text, pos, regex) {
|
exports.retrievePrecedingIdentifier = function(text, pos, regex) {
|
||||||
regex = regex || ID_REGEX;
|
regex = regex || ID_REGEX;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue