mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 04:07:58 +01:00
changes :macro to :play + delMarcos to deleteMacros
This commit is contained in:
2
NEWS
2
NEWS
@@ -9,7 +9,7 @@
|
||||
* IMPORTANT: changed 'I' key to Ctrl-Q to also work in textboxes
|
||||
* IMPORTANT: :bmarks! and :history! open the matching items now in a tab, instead
|
||||
of bringing up the bookmarks/history window
|
||||
* :macro for playing a recorded macro
|
||||
* :play for playing a recorded macro
|
||||
* :[del]macros [regex] for listing/deleting recorded macros
|
||||
* :set! now lets you change about:config prefs similar to :set
|
||||
* new :command to add user defined commands
|
||||
|
||||
@@ -1464,7 +1464,7 @@ vimperator.Commands = function () //{{{
|
||||
if (!arg)
|
||||
vimperator.echoerr("E474: Invalid argument");
|
||||
else
|
||||
vimperator.events.delMacros(arg);
|
||||
vimperator.events.deleteMacros(arg);
|
||||
},
|
||||
{
|
||||
usage: ["delmac[ros] [regex]"],
|
||||
@@ -1472,7 +1472,7 @@ vimperator.Commands = function () //{{{
|
||||
help: "Delete recorded macros matching a regular expression."
|
||||
}
|
||||
));
|
||||
commandManager.add(new vimperator.Command(["mac[ro]"],
|
||||
commandManager.add(new vimperator.Command(["pl[ay]"],
|
||||
function (arg)
|
||||
{
|
||||
if (!arg)
|
||||
@@ -1481,9 +1481,8 @@ vimperator.Commands = function () //{{{
|
||||
vimperator.events.playMacro(arg);
|
||||
},
|
||||
{
|
||||
usage: ["delmac[ros] [regex]"],
|
||||
shortHelp: "Delete macros matching a regex",
|
||||
help: "Delete recorded macros matching a regular expression.",
|
||||
usage: ["pl[ay] <macro>"],
|
||||
shortHelp: "Play a macro",
|
||||
completer: function (filter) { return vimperator.completion.macros(filter); }
|
||||
}
|
||||
));
|
||||
|
||||
@@ -552,19 +552,19 @@ vimperator.Events = function () //{{{
|
||||
|
||||
for (var item in macros)
|
||||
{
|
||||
if (item.match(re))
|
||||
if (re.test(item))
|
||||
filtered[item] = macros[item];
|
||||
}
|
||||
return filtered; //XXX: returns a real copy, since this is only a 'var ..'?
|
||||
},
|
||||
|
||||
delMacros: function (filter)
|
||||
deleteMacros: function (filter)
|
||||
{
|
||||
var re = new RegExp(filter);
|
||||
|
||||
for (var item in macros)
|
||||
{
|
||||
if (item.match(re))
|
||||
if (re.test(item))
|
||||
delete macros[item];
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user