always call the callback form setMode

This commit is contained in:
nightwing 2015-01-05 00:02:41 +04:00
commit f4ea1ccb6a

View file

@ -893,17 +893,17 @@ var EditSession = function(text, mode) {
config.loadModule(["mode", path], function(m) { config.loadModule(["mode", path], function(m) {
if (this.$modeId !== path) if (this.$modeId !== path)
return cb && cb(); return cb && cb();
if (this.$modes[path] && !options) if (this.$modes[path] && !options) {
return this.$onChangeMode(this.$modes[path]); this.$onChangeMode(this.$modes[path]);
if (m && m.Mode) { } else if (m && m.Mode) {
m = new m.Mode(options); m = new m.Mode(options);
if (!options) { if (!options) {
this.$modes[path] = m; this.$modes[path] = m;
m.$id = path; m.$id = path;
} }
this.$onChangeMode(m); this.$onChangeMode(m);
cb && cb();
} }
cb && cb();
}.bind(this)); }.bind(this));
// set mode to text until loading is finished // set mode to text until loading is finished