1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 09:45:46 +01:00

Fix :viu!.

--HG--
extra : rebase_source : e9f4ea7ad0d59656167aeb2e0fca276c8375c8ee
This commit is contained in:
Kris Maglione
2010-12-03 17:30:53 -05:00
parent 349205aed1
commit 09bfc60446
4 changed files with 10 additions and 5 deletions

View File

@@ -1157,7 +1157,7 @@ const Dactyl = Module("dactyl", {
// show a usage index either in the MOW or as a full help page
showHelpIndex: function (tag, items, inMow) {
if (inMow)
dactyl.echo(template.usage(items), commandline.FORCE_MULTILINE);
commandline.commandOutput(template.usage(array(items).sort(function (a, b) String.localeCompare(a.name, b.name))));
else
dactyl.help(tag);
}

View File

@@ -186,7 +186,13 @@ const Mappings = Module("mappings", {
// NOTE: just normal mode for now
/** @property {Iterator(Map)} @private */
__iterator__: function () this._mappingsIterator([modes.NORMAL], this._main),
__iterator__: function () {
let mode = modes.NORMAL;
let seen = {};
for (let map in iterAll(values(this._user[mode]), values(this._main[mode])))
if (!set.add(seen, map.name))
yield map;
},
// used by :mkpentadactylrc to save mappings
/**

View File

@@ -1013,7 +1013,7 @@ function octal(decimal) parseInt(decimal, 8);
*/
const array = Class("array", Array, {
init: function (ary) {
if (isinstance(ary, ["Iterator", "Generator"]))
if (isinstance(ary, ["Iterator", "Generator"]) || "__iterator__" in ary)
ary = [k for (k in ary)];
else if (ary.length)
ary = Array.slice(ary);