Skip to content

Commit 63eace6

Browse files
committed
Make 'delbmarks' honour silent mode (issue #5)
1 parent c16853f commit 63eace6

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

common/content/bookmarks.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,22 @@ const Bookmarks = Module("bookmarks", {
599599
"Delete a bookmark",
600600
function (args) {
601601
if (args.bang) {
602-
commandline.input("This will delete all bookmarks. Would you like to continue? (yes/[no]) ",
603-
function (resp) {
604-
if (resp && resp.match(/^y(es)?$/i)) {
605-
bookmarks._cache.bookmarks.forEach(function (bmark) { services.get("bookmarks").removeItem(bmark.id); });
606-
liberator.echomsg("All bookmarks deleted");
607-
}
608-
});
602+
603+
function deleteAll() {
604+
bookmarks._cache.bookmarks.forEach(function (bmark) { services.get("bookmarks").removeItem(bmark.id); });
605+
liberator.echomsg("All bookmarks deleted");
606+
}
607+
608+
if (commandline.silent)
609+
deleteAll();
610+
else {
611+
commandline.input("This will delete all bookmarks. Would you like to continue? (yes/[no]) ",
612+
function (resp) {
613+
if (resp && resp.match(/^y(es)?$/i)) {
614+
deleteAll();
615+
}
616+
});
617+
}
609618
}
610619
else {
611620
let url = args.string || buffer.URL;

vimperator/NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Version 3.8.3
33
* Push minVersion to Firefox25, as we have some problems on older Firefoxs regarding search
44
* Make 'gH' command work with multiple home pages
5+
* Don't prompt user for confirmation when 'delbmarks!' command is invoked in silent mode
56

67
2014-02-14: A Valentine's gift
78
* Version 3.8.2

0 commit comments

Comments
 (0)