1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-23 18:23:32 +01:00

add 'hlsearch' option

This commit is contained in:
Doug Kearns
2007-09-03 19:10:32 +00:00
parent 72e352abbe
commit 6d33284a76
2 changed files with 16 additions and 4 deletions

View File

@@ -28,13 +28,12 @@ the terms of any one of the MPL, the GPL or the LGPL.
// make sure you only create this object when the "vimperator" object is ready
// vimperator.search = new function()
function Search() //{{{
{
var self = this; // needed for callbacks since "this" is the "vimperator" object in a callback
var found = false; // true if the last search was successful
var self = this; // needed for callbacks since "this" is the "vimperator" object in a callback
var found = false; // true if the last search was successful
var backwards = false;
var lastsearch = ""; // keep track of the last searched string
var lastsearch = ""; // keep track of the last searched string
var lastsearch_backwards = false; // like "backwards", but for the last search, so if you cancel a search with <esc> this is not set
// Event handlers for search - closure is needed
@@ -145,6 +144,12 @@ function Search() //{{{
vimperator.focusContent();
}
this.highlight = function()
{
if (lastsearch)
gFindBar._highlightDoc("yellow", "black", lastsearch);
}
this.clear = function()
{
gFindBar._highlightDoc();