File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -241,16 +241,17 @@ const Events = Module("events", {
241
241
} ,
242
242
243
243
/**
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
+ */
249
250
deleteMacros : function ( filter ) {
250
- let re = RegExp ( filter ) ;
251
-
251
+ let re = RegExp ( "[" + filter . replace ( / \s + / g , "" ) + "]" ) ;
252
+
252
253
for ( let [ item , ] in this . _macros ) {
253
- if ( re . test ( item ) || ! filter )
254
+ if ( re . test ( item ) )
254
255
this . _macros . remove ( item ) ;
255
256
}
256
257
} ,
You can’t perform that action at this time.
0 commit comments