summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2009-05-22 12:47:57 +1000
committerDoug Kearns <dougkearns@gmail.com>2009-05-22 12:47:57 +1000
commitda89552a1ea53ccdea1e59554c52d19228230110 (patch)
tree724a0f172eff577640a25a12c3749e017aa525e3
parent72e13d9e9d298faff8f5a7aa1ee43ddf302e1709 (diff)
downloadpentadactyl-da89552a1ea53ccdea1e59554c52d19228230110.tar.gz
Add @: mapping.
-rw-r--r--common/content/commands.js24
-rw-r--r--common/content/liberator.js1
-rw-r--r--common/content/ui.js1
-rw-r--r--vimperator/NEWS4
-rw-r--r--vimperator/locale/en-US/index.txt1
-rw-r--r--vimperator/locale/en-US/repeat.txt27
6 files changed, 49 insertions, 9 deletions
diff --git a/common/content/commands.js b/common/content/commands.js
index 9b8e5d07..80daabe3 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -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.
*
@@ -958,6 +961,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 ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
diff --git a/common/content/liberator.js b/common/content/liberator.js
index 586c231d..071dc965 100644
--- a/common/content/liberator.js
+++ b/common/content/liberator.js
@@ -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);
},
diff --git a/common/content/ui.js b/common/content/ui.js
index 1da69d11..288e367b 100644
--- a/common/content/ui.js
+++ b/common/content/ui.js
@@ -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) {
diff --git a/vimperator/NEWS b/vimperator/NEWS
index fb71518d..318858b2 100644
--- a/vimperator/NEWS
+++ b/vimperator/NEWS
@@ -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'
diff --git a/vimperator/locale/en-US/index.txt b/vimperator/locale/en-US/index.txt
index 3da260a3..8c7349b9 100644
--- a/vimperator/locale/en-US/index.txt
+++ b/vimperator/locale/en-US/index.txt
@@ -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 +
diff --git a/vimperator/locale/en-US/repeat.txt b/vimperator/locale/en-US/repeat.txt
index 8d1adb3a..64fdef07 100644
--- a/vimperator/locale/en-US/repeat.txt
+++ b/vimperator/locale/en-US/repeat.txt
@@ -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|