mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-20 14:44:12 +01:00
merge minor Search#find refactoring from MAIN
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user