Skip to content

Commit 64496a1

Browse files
committed
delmacros matches delqmarks
1 parent fa52639 commit 64496a1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

common/content/events.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,17 @@ const Events = Module("events", {
241241
},
242242

243243
/**
244-
* Deletes all macros matching <b>filter</b>.
245-
*
246-
* @param {string} filter A regular expression filter string. A null
247-
* filter deletes all macros.
248-
*/
244+
* Deletes the specified macros. The <b>filter</b> is a list of
245+
* macros and ranges are supported. Eg. "ab c d e-k".
246+
*
247+
* @param {string} filter The list of macros to delete.
248+
*
249+
*/
249250
deleteMacros: function (filter) {
250-
let re = RegExp(filter);
251-
251+
let re = RegExp("[" + filter.replace(/\s+/g, "") + "]");
252+
252253
for (let [item, ] in this._macros) {
253-
if (re.test(item) || !filter)
254+
if (re.test(item))
254255
this._macros.remove(item);
255256
}
256257
},

0 commit comments

Comments
 (0)