From 414667916ec8b94fd4e3b0004d3c84ed65256e46 Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 14 Sep 2013 14:55:41 +0400 Subject: [PATCH] always call setMode callback after the event --- lib/ace/edit_session.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index ea1e92c3..41e0fa15 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -886,8 +886,9 @@ var EditSession = function(text, mode) { this.$modes["ace/mode/text"] = new TextMode(); if (this.$modes[path] && !options) { - cb && cb(this.mode); - return this.$onChangeMode(this.$modes[path]); + this.$onChangeMode(this.$modes[path]); + cb && cb(); + return; } // load on demand this.$modeId = path; @@ -903,7 +904,7 @@ var EditSession = function(text, mode) { m.$id = path; } this.$onChangeMode(m); - cb && cb(this.mode); + cb && cb(); } }.bind(this));