make sure operationEnd events are not emitted to wrong session

pull/51/merge
nightwing 2015-03-31 17:00:25 +04:00
rodzic 9c1f27d6d8
commit 539cf4b6e2
1 zmienionych plików z 6 dodań i 0 usunięć

6
node_modules/ace/lib/ace/editor.js wygenerowano vendored
Wyświetl plik

@ -275,6 +275,10 @@ var Editor = function(renderer, session) {
this.setSession = function(session) {
if (this.session == session)
return;
// make sure operationEnd events are not emitted to wrong session
if (this.curOp) this.endOperation();
this.curOp = {};
var oldSession = this.session;
if (oldSession) {
@ -372,6 +376,8 @@ var Editor = function(renderer, session) {
oldSession: oldSession
});
this.curOp = null;
oldSession && oldSession._signal("changeEditor", {oldEditor: this});
session && session._signal("changeEditor", {editor: this});
};