diff --git a/lib/ace/incremental_search.js b/lib/ace/incremental_search.js index fc410b89..88615006 100644 --- a/lib/ace/incremental_search.js +++ b/lib/ace/incremental_search.js @@ -73,22 +73,21 @@ oop.inherits(IncrementalSearch, Search); this.$options.backwards = backwards; ed.keyBinding.addKeyboardHandler(this.$keyboardHandler); // we need to completely intercept paste, just registering an event handler does not work - this.$originalEditorOnPaste = ed.onPaste; - ed.onPaste = this.onPaste.bind(this); + this.$originalEditorOnPaste = ed.onPaste; ed.onPaste = this.onPaste.bind(this); this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this)); - this.$onPasteHandler = ed.addEventListener('paste', this.onPaste.bind(this)); this.selectionFix(ed); this.statusMessage(true); } this.deactivate = function(reset) { this.cancelSearch(reset); - this.$editor.keyBinding.removeKeyboardHandler(this.$keyboardHandler); + var ed = this.$editor; + ed.keyBinding.removeKeyboardHandler(this.$keyboardHandler); if (this.$mousedownHandler) { - this.$editor.removeEventListener('mousedown', this.$mousedownHandler); + ed.removeEventListener('mousedown', this.$mousedownHandler); delete this.$mousedownHandler; } - this.$editor.onPaste = this.$originalEditorOnPaste; + ed.onPaste = this.$originalEditorOnPaste; this.message(''); }