diff --git a/content/bookmarks.js b/content/bookmarks.js index 38f70c2d..f740e90e 100644 --- a/content/bookmarks.js +++ b/content/bookmarks.js @@ -78,13 +78,7 @@ function Bookmarks() //{{{ let tags = taggingService.getTagsForURI(uri, {}) || []; //return bookmarks.push(new Bookmark(node.uri, node.title, null, keyword, tags, node.itemId)); - return bookmarks.push({ url: node.uri, - title: node.title, - get icon() getFavicon(node.uri), // TODO; must be a direct way to get the icon - keyword: keyword, - tags: tags, - id: node.itemId, - get xml() template.bookmarkItem(this)}); + return bookmarks.push(new Bookmark(node.uri, node.title, null, keyword, tags, node.itemId)); } function readBookmark(id) @@ -287,6 +281,9 @@ function Bookmarks() //{{{ }, { argCount: "0" }); + function tags() util.Array.uniq(util.Array.flatten([b.tags for ([k, b] in Iterator(cache.bookmarks))])) + .map(function (tag) [tag, tag]); + commands.add(["bma[rk]"], "Add a bookmark", function (args, special) @@ -322,8 +319,14 @@ function Bookmarks() //{{{ }, { bang: true, - completer: function (context) completion.bookmark(context.filter), - options: [[["-tags", "-T"], commands.OPTION_LIST]] + completer: function (context, args) + { + if (args.completeOpt) + return; + context.advance(args.completeStart); // TODO: Move this to completion.ex? + completion.url(context, "b"); + }, + options: [[["-tags", "-T"], commands.OPTION_LIST, null, tags]] }); commands.add(["delbm[arks]"], diff --git a/content/commands.js b/content/commands.js index 4463d6f4..15c70c3b 100644 --- a/content/commands.js +++ b/content/commands.js @@ -534,7 +534,7 @@ function Commands() //{{{ if (complete) { - if (quote || !invalid && count) + if (quote || !invalid && count && i + optname.length + 1 + arg.length == str.length) { args.completeStart += optname.length + 1; args.completeOpt = opt[0][0]; diff --git a/content/completion.js b/content/completion.js index 823708da..0306dbf7 100644 --- a/content/completion.js +++ b/content/completion.js @@ -266,9 +266,9 @@ function Completion() //{{{ completion.filterMap = [null, function (v) template.highlight(v, true)]; - if (cacheFilter.js === cacheKey) - return cacheResults.js; - cacheFilter.js = cacheKey; + //if (cacheFilter.js === cacheKey) + // return cacheResults.js; + //cacheFilter.js = cacheKey; // Can't use the cache. Build a member list. compl = []; diff --git a/content/ui.js b/content/ui.js index e42966e9..0f391bac 100644 --- a/content/ui.js +++ b/content/ui.js @@ -1344,7 +1344,7 @@ function ItemList(id) //{{{ function fill(offset) { let diff = offset - startIndex; - if (items == null || offset == null || offset - startIndex == 0 || offset < 0) + if (items == null || offset == null || diff == 0 || offset < 0) return; startIndex = offset;