diff --git a/content/bookmarks.js b/content/bookmarks.js index 18a8432c..ab7f845d 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -110,7 +110,8 @@ vimperator.Bookmarks = function () //{{{ return vimperator.completion.filterURLArray(bookmarks, filter, tags); }, - add: function (title, url, keyword, tags) + // if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder + add: function (starOnly, title, url, keyword, tags) { if (!bookmarks) load(); @@ -122,7 +123,10 @@ vimperator.Bookmarks = function () //{{{ try { var uri = ioService.newURI(url, null, null); - var id = bookmarksService.insertBookmark(bookmarksService.placesRoot, uri, -1, title); + var id = bookmarksService.insertBookmark( + starOnly ? bookmarksService.unfiledBookmarksFolder : bookmarksService.bookmarksMenuFolder, + uri, -1, title); + if (!id) return false; @@ -165,7 +169,7 @@ vimperator.Bookmarks = function () //{{{ var extra = ""; if (title != url) extra = " (" + title + ")"; - this.add(title, url); + this.add(true, title, url); vimperator.commandline.echo("Added bookmark: " + url + extra, vimperator.commandline.HL_NORMAL, vimperator.commandline.FORCE_SINGLELINE); } }, diff --git a/content/commands.js b/content/commands.js index 8bd0e0e0..33d16682 100644 --- a/content/commands.js +++ b/content/commands.js @@ -602,7 +602,7 @@ vimperator.Commands = function () //{{{ var keyword = getOption(res.opts, "-keyword", null); var tags = getOption(res.opts, "-tags", []); - if (vimperator.bookmarks.add(title, url, keyword, tags)) + if (vimperator.bookmarks.add(false, title, url, keyword, tags)) { var extra = ""; if (title != url) diff --git a/content/mappings.js b/content/mappings.js index 3240fe8a..b754b5e3 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -425,7 +425,9 @@ vimperator.Mappings = function () //{{{ function () { vimperator.bookmarks.toggle(vimperator.buffer.URL); }, { shortHelp: "Toggle bookmarked state of current URL", - help: "Add/remove a bookmark for the current location, depending if it already is bookmarked or not." + help: "Add/remove a bookmark for the current location, depending if it already is bookmarked or not. " + + "In contrast to the :bmark command, the bookmark is just 'starred' " + + "which means it is placed in the 'Unfiled Bookmarks Folder' instead of the bookmarks menu." } )); addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["b"],