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