From ab69224856cdcc3dbbab17138b85da252b2f93ba Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Wed, 4 Feb 2015 20:43:15 -0800 Subject: [PATCH] Simple fix for #120 Avoids raising a warning by placing `self.ready` in a function. --- lib/ui/Editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/Editor.js b/lib/ui/Editor.js index 5312a8a..b1d3464 100644 --- a/lib/ui/Editor.js +++ b/lib/ui/Editor.js @@ -77,7 +77,7 @@ Editor.prototype.open = Promise.method(function (path) { path = util.resolvePath(path); return chardet.detectFileAsync(path) // return Promise.resolve(chardet.detectFileSync(path)) .then(function (encoding) { self.textBuf.setEncoding(encoding); }) - .then(self.ready) // ensures textBuf path-changed is triggered in _initHandlers + .then(function () { self.ready; }) // ensures textBuf path-changed is triggered in _initHandlers .then(function () { return self.textBuf.setPath(path); }) .then(function () { return self.textBuf.load(); }) .then(function () { self.selection.setHeadPosition(new Point(0, 0)); })