mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-18 19:15:45 +01:00
:delmacros regex added
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
|
||||||
* :macros [regex] for listing 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
|
||||||
* new setCustomMode for plugin writers
|
* new setCustomMode for plugin writers
|
||||||
|
|||||||
@@ -1458,7 +1458,20 @@ vimperator.Commands = function () //{{{
|
|||||||
help: "List recorded macros matching the optional regular expression. If no regex is given, list all."
|
help: "List recorded macros matching the optional regular expression. If no regex is given, list all."
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
commandManager.add(new vimperator.Command(["delmac[ros]"],
|
||||||
|
function (arg)
|
||||||
|
{
|
||||||
|
if (!arg)
|
||||||
|
vimperator.echoerr("E474: Invalid argument");
|
||||||
|
else
|
||||||
|
vimperator.events.delMacros(arg);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
usage: ["delmac[ros] [regex]"],
|
||||||
|
shortHelp: "Delete macros matching a regex",
|
||||||
|
help: "Delete recorded macros matching a regular expression."
|
||||||
|
}
|
||||||
|
));
|
||||||
// 0 args -> list all maps
|
// 0 args -> list all maps
|
||||||
// 1 arg -> list the maps starting with args
|
// 1 arg -> list the maps starting with args
|
||||||
// 2 args -> map arg1 to arg*
|
// 2 args -> map arg1 to arg*
|
||||||
|
|||||||
@@ -485,7 +485,6 @@ vimperator.Events = function () //{{{
|
|||||||
window.removeEventListener("keydown", this.onKeyDown, true);
|
window.removeEventListener("keydown", this.onKeyDown, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
startRecording: function (macro)
|
startRecording: function (macro)
|
||||||
{
|
{
|
||||||
if (!/[a-zA-Z0-9]/.test(macro))
|
if (!/[a-zA-Z0-9]/.test(macro))
|
||||||
@@ -556,6 +555,17 @@ vimperator.Events = function () //{{{
|
|||||||
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)
|
||||||
|
{
|
||||||
|
var re = new RegExp(filter);
|
||||||
|
|
||||||
|
for (var item in macros)
|
||||||
|
{
|
||||||
|
if (item.match(re))
|
||||||
|
delete macros[item];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// This method pushes keys into the event queue from vimperator
|
// This method pushes keys into the event queue from vimperator
|
||||||
// it is similar to vim's feedkeys() method, but cannot cope with
|
// it is similar to vim's feedkeys() method, but cannot cope with
|
||||||
// 2 partially feeded strings, you have to feed one parsable string
|
// 2 partially feeded strings, you have to feed one parsable string
|
||||||
|
|||||||
Reference in New Issue
Block a user