diff --git a/lib/ace/editor.js b/lib/ace/editor.js index a8efe242..e6d30eca 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -397,6 +397,9 @@ var Editor = function(renderer, session) { * Emitted once the editor comes into focus. **/ this.onFocus = function() { + if (this.$isFocused) + return; + this.$isFocused = true; this.renderer.showCursor(); this.renderer.visualizeFocus(); this._emit("focus"); @@ -408,6 +411,9 @@ var Editor = function(renderer, session) { * Emitted once the editor has been blurred. **/ this.onBlur = function() { + if (!this.$isFocused) + return; + this.$isFocused = false; this.renderer.hideCursor(); this.renderer.visualizeBlur(); this._emit("blur");