mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-24 11:23:31 +01:00
Fix bookmark tag completion.
This commit is contained in:
@@ -339,14 +339,8 @@ var Bookmarks = Module("bookmarks", {
|
|||||||
getSearchURL: function getSearchURL(text, useDefsearch) {
|
getSearchURL: function getSearchURL(text, useDefsearch) {
|
||||||
let query = (useDefsearch ? options["defsearch"] + " " : "") + text;
|
let query = (useDefsearch ? options["defsearch"] + " " : "") + text;
|
||||||
|
|
||||||
// ripped from Firefox
|
let [keyword, param] = util.split(query, " ", 2);
|
||||||
var keyword = query;
|
param = param || "";
|
||||||
var param = "";
|
|
||||||
var offset = query.indexOf(" ");
|
|
||||||
if (offset > 0) {
|
|
||||||
keyword = query.substr(0, offset);
|
|
||||||
param = query.substr(offset + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
var engine = hasOwnProperty(bookmarks.searchEngines, keyword) && bookmarks.searchEngines[keyword];
|
var engine = hasOwnProperty(bookmarks.searchEngines, keyword) && bookmarks.searchEngines[keyword];
|
||||||
if (engine) {
|
if (engine) {
|
||||||
@@ -438,7 +432,7 @@ var Bookmarks = Module("bookmarks", {
|
|||||||
description: "A comma-separated list of tags",
|
description: "A comma-separated list of tags",
|
||||||
completer: function tags(context, args) {
|
completer: function tags(context, args) {
|
||||||
context.generate = function () Ary(b.tags
|
context.generate = function () Ary(b.tags
|
||||||
for (b in bookmarkcache)
|
for (b of bookmarkcache)
|
||||||
if (b.tags))
|
if (b.tags))
|
||||||
.flatten().uniq().array;
|
.flatten().uniq().array;
|
||||||
context.keys = { text: util.identity, description: util.identity };
|
context.keys = { text: util.identity, description: util.identity };
|
||||||
|
|||||||
Reference in New Issue
Block a user