mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 15:14:12 +01:00
Add a ! bang version of :delbmarks to delete all bookmarks.
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user