1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-14 03:35:47 +01:00

Update :listkeys for :mapgroups.

This commit is contained in:
Kris Maglione
2011-01-19 14:40:47 -05:00
parent d41b414171
commit 807c7a4aba
5 changed files with 42 additions and 12 deletions

View File

@@ -289,7 +289,7 @@ var Mappings = Module("mappings", {
iterate: function (mode) { iterate: function (mode) {
let seen = {}; let seen = {};
for (let hive in this.hives.iterValues()) for (let hive in this.hives.iterValues())
for (let map in values(hive.getStack(mode))) for (let map in hive.getStack(mode).iterValues())
if (!set.add(seen, map.name)) if (!set.add(seen, map.name))
yield map; yield map;
}, },
@@ -732,9 +732,22 @@ var Mappings = Module("mappings", {
let args = { let args = {
getMode: function (args) findMode(args["-mode"]), getMode: function (args) findMode(args["-mode"]),
iterate: function (args) { iterate: function (args) {
for (let map in mappings.iterate(this.getMode(args))) let mainMode = this.getMode(args);
for (let name in values(map.names)) let seen = {};
yield { name: name, __proto__: map }; for (let mode in values([mainMode].concat(mainMode.bases)))
for (let hive in mappings.hives.iterValues())
for (let map in array.iterValues(hive.getStack(mode)))
for (let name in values(map.names))
if (!set.add(seen, name)) {
yield {
name: name,
columns: [
mode == mainMode ? "" : <span highlight="Object" style="padding-right: 1em;">{mode.name}</span>,
hive.name == "builtin" ? "" : <span highlight="Object" style="padding-right: 1em;">{hive.name}</span>,
],
__proto__: map
};
}
}, },
format: { format: {
description: function (map) (XML.ignoreWhitespace = false, XML.prettyPrinting = false, <> description: function (map) (XML.ignoreWhitespace = false, XML.prettyPrinting = false, <>
@@ -744,7 +757,8 @@ var Mappings = Module("mappings", {
{template.linkifyHelp(map.description + (map.rhs ? ": " + map.rhs : ""))} {template.linkifyHelp(map.description + (map.rhs ? ": " + map.rhs : ""))}
</>), </>),
help: function (map) let (char = array.compact(map.modes.map(function (m) m.char))[0]) help: function (map) let (char = array.compact(map.modes.map(function (m) m.char))[0])
char === "n" ? map.name : char ? char + "_" + map.name : "" char === "n" ? map.name : char ? char + "_" + map.name : "",
headings: ["Command", "Mode", "Group", "Description"]
} }
} }

View File

@@ -22,7 +22,7 @@ var StatusLine = Module("statusline", {
#addon-bar > #addonbar-closebutton { visibility: collapse; } #addon-bar > #addonbar-closebutton { visibility: collapse; }
#addon-bar > xul|toolbarspring { visibility: collapse; } #addon-bar > xul|toolbarspring { visibility: collapse; }
]]></css>); ]]></css>);
highlight.loadCSS(String.replace(<![CDATA[ highlight.loadCSS(util.compileMacro(<![CDATA[
!AddonBar;#addon-bar { !AddonBar;#addon-bar {
padding-left: 0 !important; padding-left: 0 !important;
min-height: 18px !important; min-height: 18px !important;
@@ -36,7 +36,7 @@ var StatusLine = Module("statusline", {
min-width: 0 !important; min-width: 0 !important;
} }
AddonButton:not(:hover) background: transparent !important; AddonButton:not(:hover) background: transparent !important;
]]>, "<padding>", util.OS.isMacOSX ? "padding-right: 10px !important;" : "")); ]]>)({ padding: util.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
} }
let _commandline = "if (window.dactyl) return dactyl.modules.commandline"; let _commandline = "if (window.dactyl) return dactyl.modules.commandline";

View File

@@ -622,7 +622,7 @@ var IO = Module("io", {
file.append(config.name + ".vim"); file.append(config.name + ".vim");
dactyl.assert(!file.exists() || args.bang, "File exists"); dactyl.assert(!file.exists() || args.bang, "File exists");
let template = util.compileMacro(String(<![CDATA[ let template = util.compileMacro(<![CDATA[
" Vim syntax file " Vim syntax file
" Language: Pentadactyl configuration file " Language: Pentadactyl configuration file
" Maintainer: Doug Kearns <dougkearns@gmail.com> " Maintainer: Doug Kearns <dougkearns@gmail.com>
@@ -707,7 +707,7 @@ let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" vim: tw=130 et ts=4 sw=4: " vim: tw=130 et ts=4 sw=4:
]]>), true); ]]>, true);
const WIDTH = 80; const WIDTH = 80;
function wrap(prefix, items, sep) { function wrap(prefix, items, sep) {

View File

@@ -319,8 +319,9 @@ var Template = Module("Template", {
usage: function usage(iter, format) { usage: function usage(iter, format) {
XML.ignoreWhitespace = false; XML.prettyPrinting = false; XML.ignoreWhitespace = false; XML.prettyPrinting = false;
let desc = format && format.description || function (item) template.linkifyHelp(item.description); format = format || {};
let help = format && format.help || function (item) item.name; let desc = format.description || function (item) template.linkifyHelp(item.description);
let help = format.help || function (item) item.name;
function sourceLink(frame) { function sourceLink(frame) {
let source = template.sourceLink(frame); let source = template.sourceLink(frame);
source.@NS::hint = source.text(); source.@NS::hint = source.text();
@@ -328,6 +329,20 @@ var Template = Module("Template", {
} }
// <e4x> // <e4x>
return <table> return <table>
{ format.headings ?
<tr highlight="Title" align="left">
{
this.map(format.headings, function (h) <th>{h}</th>)
}
</tr> : ""
}
{ format.columns ?
<colgroup>
{
this.map(format.columns, function (c) <col style={c}/>)
}
</colgroup> : ""
}
{ {
this.map(iter, function (item) this.map(iter, function (item)
<tr> <tr>
@@ -339,7 +354,7 @@ var Template = Module("Template", {
<span highlight="LinkInfo" xmlns:dactyl={NS}>Defined at {sourceLink(frame)}</span> <span highlight="LinkInfo" xmlns:dactyl={NS}>Defined at {sourceLink(frame)}</span>
}</span> }</span>
</td> </td>
{ template.map(item.columns, function (c) <td>{c}</td>) } { item.columns ? template.map(item.columns, function (c) <td>{c}</td>) : "" }
<td>{desc(item)}</td> <td>{desc(item)}</td>
</tr>) </tr>)
} }

View File

@@ -336,6 +336,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
(\}>) // 5 (\}>) // 5
) )
]]>, "giy"); ]]>, "giy");
macro = String(macro);
while (match = re.exec(macro)) { while (match = re.exec(macro)) {
let [, prefix, open, full, macro, close] = match; let [, prefix, open, full, macro, close] = match;
end += match[0].length; end += match[0].length;