From ffa5ad747e7bf510668d41fe5f860586a28b011a Mon Sep 17 00:00:00 2001 From: Marco Candrian Date: Sun, 16 Dec 2007 22:18:04 +0000 Subject: [PATCH] macro renamings --- content/events.js | 28 ++++++++++++++-------------- content/mappings.js | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/content/events.js b/content/events.js index 5f4352c8..ae2c8e05 100644 --- a/content/events.js +++ b/content/events.js @@ -251,7 +251,7 @@ vimperator.Events = function () //{{{ var macros = {}; var isRecording = false; var currentMacro; - var playReg = ""; + var lastMacro = ""; /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// @@ -261,24 +261,24 @@ vimperator.Events = function () //{{{ wantsModeReset: true, // used in onFocusChange since Firefox is so buggy here - startRecording: function (reg) + startRecording: function (macro) { - if (!/[a-zA-Z0-9]/.test(reg)) + if (!/[a-zA-Z0-9]/.test(macro)) { vimperator.echoerr("Register must be [a-zA-z0-9]"); return false; } vimperator.modes.add(vimperator.modes.RECORDING); //TODO: does not work/show yet - if (/[A-Z]/.test(reg)) // uppercase (append) + if (/[A-Z]/.test(macro)) // uppercase (append) { - currentMacro = reg.toLowerCase(); + currentMacro = macro.toLowerCase(); if (!macros[currentMacro]) macros[currentMacro] = ""; // initialise if it does not yet exist } else { - currentMacro = reg; + currentMacro = macro; macros[currentMacro] = ""; } @@ -286,16 +286,16 @@ vimperator.Events = function () //{{{ isRecording = true; }, - playRegister: function (reg) + playMacro: function (macro) { - if (!/[a-zA-Z0-9]/.test(reg)) + if (!/[a-zA-Z0-9]/.test(macro)) { vimperator.echoerr("Register must be [a-z0-9]"); return false; } - if (reg == "@") // use playReg if it's set + if (macro == "@") // use lastMacro if it's set { - if (!playReg) + if (!lastMacro) { vimperator.echoerr("E748: No previously used Register"); return false; @@ -303,13 +303,13 @@ vimperator.Events = function () //{{{ } else { - playReg = reg.toLowerCase(); // XXX: sets last playerd reg, even if it does not yet exist + lastMacro = macro.toLowerCase(); // XXX: sets last playerd macro, even if it does not yet exist } - if (macros[playReg]) - vimperator.events.feedkeys(macros[playReg], true); // true -> noremap + if (macros[lastMacro]) + vimperator.events.feedkeys(macros[lastMacro], true); // true -> noremap else - vimperator.echoerr("Register '" + playReg + " not set"); + vimperator.echoerr("Register '" + lastMacro + " not set"); }, destroy: function () diff --git a/content/mappings.js b/content/mappings.js index 5d6a5958..613b5b1f 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -1293,17 +1293,17 @@ vimperator.Mappings = function () //{{{ addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["q"], function (arg) { vimperator.events.startRecording(arg); }, { - shortHelp: "record a macro into a register", - help: "Record typed characters into register {0-9a-zA-Z} (uppercase to append)." + + shortHelp: "record a keysequence into a macro", + help: "Available macros are {0-9a-zA-Z} (uppercase to append)." + "type 'q' to stop recording.", flags: vimperator.Mappings.flags.ARGUMENT } )); addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["@"], - function (arg) { vimperator.events.playRegister(arg); }, + function (arg) { vimperator.events.playMacro(arg); }, { - shortHelp: "Execute the contents of register {0-9a-z}. @@ repeats the previous @{0-9a-z}", + shortHelp: "Execute the contents of macro {0-9a-z}. @@ repeats the previous @{0-9a-z}", flags: vimperator.Mappings.flags.ARGUMENT } ));