Cleanup autocomplete.js

Consistently use .bind(this) instead of that = this
This commit is contained in:
Aaron O'Mullan 2014-02-08 00:32:16 +01:00
commit c52278a64e

View file

@ -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);