From 125781daf614b9338d43f23bcf738a8a7c666b57 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 11 Aug 2007 13:07:19 +0000 Subject: [PATCH] add support for the special version of :delqmarks! --- chrome/content/vimperator/bookmarks.js | 8 ++++++-- chrome/content/vimperator/commands.js | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/chrome/content/vimperator/bookmarks.js b/chrome/content/vimperator/bookmarks.js index 75b9f5e3..7e12984a 100644 --- a/chrome/content/vimperator/bookmarks.js +++ b/chrome/content/vimperator/bookmarks.js @@ -722,15 +722,14 @@ function QuickMarks() //{{{ /////////////////////////////////////////////////////////////////////////////{{{ var qmarks = {}; - // load the saved quickmarks -- TODO: change to sqlite var saved_marks = Options.getPref("quickmarks", "").split("\n"); + // load the saved quickmarks -- TODO: change to sqlite for (var i = 0; i < saved_marks.length - 1; i += 2) { qmarks[saved_marks[i]] = saved_marks[i + 1]; } - // TODO: should we sort by a-zA-Z0-9 rather than 0-9A-Za-z? /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -751,6 +750,11 @@ function QuickMarks() //{{{ } } + this.removeAll = function() + { + qmarks = {}; + } + this.jumpTo = function(qmark, where) { var url = qmarks[qmark]; diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 3d8921c1..1983df55 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -445,7 +445,10 @@ function Commands() //{{{ return } - vimperator.quickmarks.remove(args); + if (special) + vimperator.quickmarks.removeAll(); + else + vimperator.quickmarks.remove(args); }, { usage: ["delqm[arks] {marks}", "delqm[arks]!"],