always call setMode callback after the event

This commit is contained in:
nightwing 2013-09-14 14:55:41 +04:00
commit 414667916e

View file

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