Cleanup autocomplete.js
Consistently use .bind(this) instead of that = this
This commit is contained in:
parent
0e256ce80d
commit
c52278a64e
1 changed files with 16 additions and 17 deletions
|
|
@ -236,7 +236,6 @@ var Autocomplete = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateCompletions = function(keepPopupPosition) {
|
this.updateCompletions = function(keepPopupPosition) {
|
||||||
var that = this;
|
|
||||||
if (keepPopupPosition && this.base && this.completions) {
|
if (keepPopupPosition && this.base && this.completions) {
|
||||||
var pos = this.editor.getCursorPosition();
|
var pos = this.editor.getCursorPosition();
|
||||||
var prefix = this.editor.session.getTextRange({start: this.base, end: pos});
|
var prefix = this.editor.session.getTextRange({start: this.base, end: pos});
|
||||||
|
|
@ -262,8 +261,8 @@ var Autocomplete = function() {
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
// Calcul prefix
|
// Calcul prefix
|
||||||
var session = that.editor.getSession();
|
var session = this.editor.getSession();
|
||||||
var pos = that.editor.getCursorPosition();
|
var pos = this.editor.getCursorPosition();
|
||||||
var line = session.getLine(pos.row);
|
var line = session.getLine(pos.row);
|
||||||
var prefix = util.retrievePrecedingIdentifier(line, pos.column);
|
var prefix = util.retrievePrecedingIdentifier(line, pos.column);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue