1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-05 06:45:45 +01:00

Add a ! bang version of :delbmarks to delete all bookmarks.

This commit is contained in:
Doug Kearns
2009-08-09 01:50:59 +10:00
parent e36f9780a7
commit 415db95601
4 changed files with 25 additions and 9 deletions

View File

@@ -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
});

View File

@@ -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]

View File

@@ -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]<Tab>[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]

View File

@@ -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]<Tab>[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]