1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 17:04:12 +01:00

Highlight substrings matching the filter in completions. Fix javascript completion and :hi. Run dump() arguments through objectToString and append "\n"

This commit is contained in:
Kris Maglione
2008-10-07 20:33:44 +00:00
parent 01e89bc6d8
commit 08ac946225
7 changed files with 109 additions and 38 deletions

View File

@@ -80,13 +80,14 @@ liberator.template = {
{
let lcstr = str.toLowerCase();
let lcfilter = filter.toLowerCase();
str = str.replace(" ", " ");
let s = <></>;
let start = 0;
let i;
while ((i = lca.indexOf(lcfilter, start)) > -1)
while ((i = lcstr.indexOf(lcfilter, start)) > -1)
{
s += <>{str.substring(start, i)}</>;
s += <span style="font-weight: bold">{str.substr(i, filter.length)}</span>;
s += <span class="hl-Filter">{str.substr(i, filter.length)}</span>;
start = i + filter.length;
}
return s + <>{str.substr(start)}</>;