mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 22:37:58 +01:00
Add @: mapping.
This commit is contained in:
@@ -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 ////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
|
||||
@@ -896,6 +896,7 @@ const liberator = (function () //{{{
|
||||
return void liberator.echoerr(err);
|
||||
if (!silent)
|
||||
commandline.command = str.replace(/^\s*:\s*/, "");
|
||||
|
||||
command.execute(args, special, count, modifiers);
|
||||
},
|
||||
|
||||
|
||||
@@ -525,6 +525,7 @@ function CommandLine() //{{{
|
||||
var input = {};
|
||||
|
||||
liberator.registerCallback("submit", modes.EX, function (command) {
|
||||
commands.repeat = command;
|
||||
liberator.execute(command);
|
||||
});
|
||||
liberator.registerCallback("complete", modes.EX, function (context) {
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2009-XX-XX:
|
||||
* version 2.2a1pre
|
||||
* add @: mapping
|
||||
|
||||
2009-05-21:
|
||||
* version 2.1
|
||||
* IMPORTANT: Default value of 'complete' has been changed from 'sfl' to 'slf'
|
||||
|
||||
@@ -90,6 +90,7 @@ section:Normal{nbsp}mode[normal-index]
|
||||
||[m]@[m]|| Play a macro +
|
||||
|
||||
||[m].[m]|| Repeat the last keyboard command +
|
||||
||[m]@:[m]|| Repeat the last Ex command [count] times +
|
||||
|
||||
||[m]]f[m]|| Focus next frame +
|
||||
||[m][f[m]|| Focus previous frame +
|
||||
|
||||
@@ -4,6 +4,24 @@ HEADER
|
||||
|
||||
Vimperator can repeat a number of commands and record macros.
|
||||
|
||||
section:Single{nbsp}repates[single-repeat]
|
||||
|
||||
|.|
|
||||
||[count].||
|
||||
____________________________________________________________________________
|
||||
Repeat the last keyboard mapping [count] times. Note that, unlike in Vim, this
|
||||
does not apply solely to editing commands, mainly because Vimperator doesn't
|
||||
have them.
|
||||
____________________________________________________________________________
|
||||
|
||||
|
||||
|@:|
|
||||
||[count]@:||
|
||||
____________________________________________________________________________
|
||||
Repeat the last Ex command [count] times.
|
||||
____________________________________________________________________________
|
||||
|
||||
|
||||
section:Macros[macros,complex-repeat]
|
||||
|
||||
|q|
|
||||
@@ -48,15 +66,6 @@ Replay the last executed macro [count] times.
|
||||
____________________________________________________________________________
|
||||
|
||||
|
||||
|.|
|
||||
||[count].||
|
||||
____________________________________________________________________________
|
||||
Repeat the last keyboard mapping [count] times. Note that, unlike in Vim, this
|
||||
does not apply solely to editing commands, mainly because Vimperator doesn't
|
||||
have them.
|
||||
____________________________________________________________________________
|
||||
|
||||
|
||||
section:Using{nbsp}scripts[using-scripts]
|
||||
|
||||
|:so| |:source|
|
||||
|
||||
Reference in New Issue
Block a user