From 635b6258c1c7c0bb916e8efd883790584a44394e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 8 Sep 2007 09:45:55 +0000 Subject: [PATCH] merge minor Search#find refactoring from MAIN --- chrome/content/vimperator/find.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chrome/content/vimperator/find.js b/chrome/content/vimperator/find.js index 7eafdcdb..913c3842 100644 --- a/chrome/content/vimperator/find.js +++ b/chrome/content/vimperator/find.js @@ -108,6 +108,7 @@ function Search() //{{{ this.find = function(str, backwards) { var fastFind = getBrowser().fastFind; + str = processPattern(str); fastFind.caseSensitive = case_sensitive; found = fastFind.find(str, false) != Components.interfaces.nsITypeAheadFind.FIND_NOTFOUND; @@ -163,15 +164,17 @@ function Search() //{{{ if (!vimperator.options["incsearch"]) return; - command = processPattern(command); this.find(command, backwards); } // Called when the enter key is pressed to trigger a search - this.searchSubmitted = function(command) + // use forced_direction if you call this function directly + this.searchSubmitted = function(command, forced_backward) { + if (typeof forced_backward === "boolean") + backwards = forced_backward; + this.clear(); - command = processPattern(command); this.find(command, backwards); this.highlight(command);