1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 07:44:14 +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

@@ -1218,17 +1218,23 @@ liberator.ItemList = function (id) //{{{
// TODO: temporary, to be changed/removed
function createRow(b, c, a, dom)
{
let row =
<tr class="compitem">
<td class="favicon"/>
<td class="completion">{b}</td>
<td class="description">{c}</td>
</tr>
/* Obviously, ItemList shouldn't know or care about this. */
let filter = liberator.completion.filterString;
if (filter)
{
b = liberator.template.highlightFilter(String(b), filter);
c = liberator.template.highlightFilter(String(c), filter);
}
if (typeof a == "function")
a = a();
if (a)
row.td[0].* = <img src={a}/>;
let row =
<tr class="compitem">
<td class="favicon">{a ? <img src={a}/> : <span/>}</td>
<td class="completion">{b}</td>
<td class="description">{c}</td>
</tr>;
if (dom)
return liberator.util.xmlToDom(row, doc);