diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index a11ce6ba..3a4ae730 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -387,13 +387,30 @@ function Bookmarks() //{{{ "Delete a bookmark", function (args) { - let url = args.string || buffer.URL; - let deletedCount = bookmarks.remove(url); + if (args.bang) + { + commandline.input("This will delete all bookmarks. Would you like to continue? (yes/[no]) ", + function (resp) + { + if (resp && resp.match(/^y(es)?$/i)) + { + bookmarks.get("").forEach(function (bmark) { bookmarks.remove(bmark.url); }); + liberator.echomsg("All bookmarks deleted", 1, commandline.FORCE_SINGLELINE); + } + }); + } + else + { + let url = args.string || buffer.URL; + let deletedCount = bookmarks.remove(url); + + liberator.echomsg(deletedCount + " bookmark(s) with url `" + url + "' deleted", 1, commandline.FORCE_SINGLELINE); + } - liberator.echomsg(deletedCount + " bookmark(s) with url `" + url + "' deleted", 1, commandline.FORCE_SINGLELINE); }, { argCount: "?", + bang: true, completer: function completer(context) completion.bookmark(context), literal: 0 }); diff --git a/vimperator/NEWS b/vimperator/NEWS index fc425cc7..4ad75ae0 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -19,6 +19,7 @@ (this might change again, as this is REALLY inconsistent, and i don't know if I like copying bugs) + * add ! version of :delbmarks to delete all bookmarks. * new "t" option for 'complete' to also switch to open tabs with :open * add [c]:toolbaropen[c], [c]:toolbarclose[c], and [c]:toolbartoggle[c] * make [c]:open[c] behavior match that of [c]:tabopen[c] and [c]:winopen[c] diff --git a/vimperator/locale/en-US/marks.txt b/vimperator/locale/en-US/marks.txt index f40b649d..eac07223 100644 --- a/vimperator/locale/en-US/marks.txt +++ b/vimperator/locale/en-US/marks.txt @@ -62,14 +62,13 @@ ________________________________________________________________________________ |:delbm| |:delbmarks| ||:delbm[arks] [a][url][a]|| + +||:delbm[arks]!|| ________________________________________________________________________________ Delete a bookmark. Deletes *all* bookmarks which match the [a][url][a]. If omitted, [a][url][a] defaults to the URL of the current buffer. Use [m][m] key on a string to complete the URL which you want to delete. -The following options WILL be interpreted in the future: - -* [!] a special version to delete ALL bookmarks +If ! is specified then all bookmarks will be deleted. ________________________________________________________________________________ section::History[history] diff --git a/xulmus/locale/en-US/marks.txt b/xulmus/locale/en-US/marks.txt index 33b3435d..2f2f2cf9 100644 --- a/xulmus/locale/en-US/marks.txt +++ b/xulmus/locale/en-US/marks.txt @@ -62,14 +62,13 @@ ________________________________________________________________________________ |:delbm| |:delbmarks| ||:delbm[arks] [a][url][a]|| + +||:delbm[arks]!|| ________________________________________________________________________________ Delete a bookmark. Deletes *all* bookmarks which match the [a][url][a]. If omitted, [a][url][a] defaults to the URL of the current buffer. Use [m][m] key on a string to complete the URL which you want to delete. -The following options WILL be interpreted in the future: - -* [!] a special version to delete ALL bookmarks +If ! is specified then all bookmarks will be deleted. ________________________________________________________________________________ section::History[history]