Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
isearch: fixing isearch onpase
  • Loading branch information
rksm committed Mar 12, 2014
1 parent c8b63ee commit 12343e0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/ace/incremental_search.js
Expand Up @@ -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('');
}

Expand Down

0 comments on commit 12343e0

Please sign in to comment.