1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-29 03:52:26 +01:00

regex instead of string compare on :macros and :macrosdump

This commit is contained in:
Marco Candrian
2008-01-20 21:07:44 +00:00
parent d21dccfff7
commit 76ab7e9616
2 changed files with 12 additions and 5 deletions

View File

@@ -541,13 +541,18 @@ vimperator.Events = function () //{{{
getMacros: function (filter)
{
var mfiltered = {};
if (!filter)
return macros;
var filtered = {};
var re = new RegExp(filter);
for (var item in macros)
{
if (filter == null || item.indexOf(filter) != -1)
mfiltered[item] = macros[item];
if (item.match(re))
filtered[item] = macros[item];
}
return mfiltered; //XXX: returns a real copy, since this is only a 'var ..'?
return filtered; //XXX: returns a real copy, since this is only a 'var ..'?
},
// This method pushes keys into the event queue from vimperator