mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-24 22:03:33 +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)
|
this.find = function(str, backwards)
|
||||||
{
|
{
|
||||||
var fastFind = getBrowser().fastFind;
|
var fastFind = getBrowser().fastFind;
|
||||||
|
str = processPattern(str);
|
||||||
|
|
||||||
fastFind.caseSensitive = case_sensitive;
|
fastFind.caseSensitive = case_sensitive;
|
||||||
found = fastFind.find(str, false) != Components.interfaces.nsITypeAheadFind.FIND_NOTFOUND;
|
found = fastFind.find(str, false) != Components.interfaces.nsITypeAheadFind.FIND_NOTFOUND;
|
||||||
@@ -163,15 +164,17 @@ function Search() //{{{
|
|||||||
if (!vimperator.options["incsearch"])
|
if (!vimperator.options["incsearch"])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
command = processPattern(command);
|
|
||||||
this.find(command, backwards);
|
this.find(command, backwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the enter key is pressed to trigger a search
|
// 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();
|
this.clear();
|
||||||
command = processPattern(command);
|
|
||||||
this.find(command, backwards);
|
this.find(command, backwards);
|
||||||
this.highlight(command);
|
this.highlight(command);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user