1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 09:17:58 +01:00

Add @: mapping.

This commit is contained in:
Doug Kearns
2009-05-22 12:47:57 +10:00
parent 72e13d9e9d
commit da89552a1e
6 changed files with 49 additions and 9 deletions

View File

@@ -462,6 +462,9 @@ function Commands() //{{{
return util.Array.itervalues(sorted);
},
/** @property {string} The last executed Ex command line. */
repeat: null,
/**
* Adds a new default command.
*
@@ -957,6 +960,27 @@ function Commands() //{{{
}
};
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// MAPPINGS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_mappings", function ()
{
mappings.add([m for ([,m] in Iterator(modes.all)) if (m != modes.INSERT)],
["@:"], "Repeat the last Ex command",
function (count)
{
if (commands.repeat)
{
for (let i in util.interruptibleRange(0, Math.max(count, 1), 100))
liberator.execute(commands.repeat);
}
else
liberator.echoerr("E30: No previous command line");
},
{ flags: Mappings.flags.COUNT });
});
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{