1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 08:08:00 +01:00

Add template.listCompleter to list completion results to the MOW.

This commit is contained in:
Kris Maglione
2008-11-25 07:30:23 +00:00
parent b543359408
commit 3affc98ea5
10 changed files with 105 additions and 136 deletions

View File

@@ -928,22 +928,12 @@ function Editor() //{{{
var searchFilter = (filter == "!") ? "!ci"
: filter + "!"; // ! -> list all, on c or i ! matches too)
let list =
<table>
{
template.map(abbrevs(), function ([lhs, rhs])
searchFilter.indexOf(rhs[0]) < 0 ? undefined :
<tr>
<td>{rhs[0]}</td>
<td>{lhs}</td>
<td>{rhs[1]}</td>
</tr>)
}
</table>;
if (list.*.length())
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
else
liberator.echoerr("No abbreviations found");
let list = [[rhs[0], lhs, rhs[1]] for ([lhs, rhs] in abbrevs()) if (searchFilter.indexOf(rhs[0]) > -1)];
if (!list.length)
return liberator.echoerr("No abbreviations found");
list = template.tabular(["", "LHS", "RHS"], [], list);
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
}
},