diff --git a/lib/ace/ext/searchbox.js b/lib/ace/ext/searchbox.js index e2d97366..01a7adea 100644 --- a/lib/ace/ext/searchbox.js +++ b/lib/ace/ext/searchbox.js @@ -52,6 +52,11 @@ var html = '\ +
\ +
\ +
\ + \ +
\ '.replace(/>\s+/g, ">"); var SearchBox = function(editor, range, showReplaceForm) { @@ -75,6 +80,10 @@ var SearchBox = function(editor, range, showReplaceForm) { this.searchBox = sb.querySelector(".ace_search_form"); this.replaceBox = sb.querySelector(".ace_replace_form"); + this.searchOptions = sb.querySelector(".ace_search_options"); + this.regExp_option = sb.querySelector(".ace_search_options #regExp"); + this.caseSensitive_option = sb.querySelector(".ace_search_options #caseSensitive"); + this.wholeWord_option = sb.querySelector(".ace_search_options #wholeWord"); this.searchInput = this.searchBox.querySelector(".ace_search_field"); this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); @@ -115,6 +124,9 @@ var SearchBox = function(editor, range, showReplaceForm) { event.addListener(this.replaceInput, "focus", function() { _this.activeInput = _this.replaceInput; }); + event.addListener(this.searchOptions, "change", function() { + _this.find(false, false); + }); }; //keybinging outsite of the searchbox @@ -163,7 +175,10 @@ var SearchBox = function(editor, range, showReplaceForm) { this.editor.find(this.searchInput.value, { skipCurrent: skipCurrent, backwards: backwards, - wrap: true + wrap: true, + regExp: this.regExp_option.checked, + caseSensitive: this.caseSensitive_option.checked, + wholeWord: this.wholeWord_option.checked }); this.editor.session.highlight(this.editor.$search.$options.re); };