Skip to content

Commit 2e708fe

Browse files
committed
Merge pull request #292 from stemar94/delmacros
Make delmacros match delqmarks
2 parents de9af33 + 49f2c29 commit 2e708fe

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

common/content/events.js

Lines changed: 6 additions & 5 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>.
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.
245248
*
246-
* @param {string} filter A regular expression filter string. A null
247-
* filter deletes all macros.
248249
*/
249250
deleteMacros: function (filter) {
250-
let re = RegExp(filter);
251+
let re = RegExp("[" + filter.replace(/\s+/g, "") + "]");
251252

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
},

common/locale/en-US/repeat.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@
7070
<spec>:delmac<oa>ros</oa> <a>args</a></spec>
7171
<spec>:delmac<oa>ros</oa>!</spec>
7272
<description>
73-
<p>
74-
Delete recorded macros matching the regular expression <a>args</a>. If <oa>!</oa> is given
75-
all macros are deleted.
76-
</p>
73+
<p>Delete the specified macros. Macros are presented as a list.</p>
74+
75+
<p>Examples:</p>
76+
77+
<ul>
78+
<li><ex>:delmacros Aa b p</ex> deletes macros A, a, b and p</li>
79+
<li><ex>:delmacros b-p</ex> deletes all macros in the range b to p</li>
80+
<li><ex>:delmacros!</ex> deletes all macros</li>
81+
</ul>
7782
</description>
7883
</item>
7984

vimperator/NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
201x-xx-xx:
2+
* :delmacro matches the syntax and behaviour of :delqmark, e.g. allowing ranges as argument
23
* Stop propagation for keyboard event if that key are contained in -except option on :ignorekeys
34
* Improvements in handling Esc for unfocusing text fields
45
* Closing the last tab of a window now respects the Firefox setting:

0 commit comments

Comments
 (0)