mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 11:47:58 +01:00
Small fix for Minefield.
This commit is contained in:
@@ -661,7 +661,7 @@ var Bookmarks = Module("bookmarks", {
|
|||||||
ctxt.compare = CompletionContext.Sort.unsorted;
|
ctxt.compare = CompletionContext.Sort.unsorted;
|
||||||
ctxt.filterFunc = null;
|
ctxt.filterFunc = null;
|
||||||
|
|
||||||
let words = ctxt.filter.split(/\s+/g);
|
let words = ctxt.filter.toLowerCase().split(/\s+/g);
|
||||||
ctxt.completions = ctxt.completions.filter(function (i) words.every(function (w) i.toLowerCase().indexOf(w) >= 0));
|
ctxt.completions = ctxt.completions.filter(function (i) words.every(function (w) i.toLowerCase().indexOf(w) >= 0));
|
||||||
|
|
||||||
ctxt.hasItems = ctxt.completions.length;
|
ctxt.hasItems = ctxt.completions.length;
|
||||||
|
|||||||
@@ -12,9 +12,8 @@
|
|||||||
*/
|
*/
|
||||||
var Marks = Module("marks", {
|
var Marks = Module("marks", {
|
||||||
init: function init() {
|
init: function init() {
|
||||||
function replacer(key, val) val instanceof Ci.nsISupports ? null : val;
|
this._localMarks = storage.newMap("local-marks", { privateData: true, replacer: Storage.Replacer.skipXpcom, store: true });
|
||||||
this._localMarks = storage.newMap("local-marks", { privateData: true, replacer: replacer, store: true });
|
this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: Storage.Replacer.skipXpcom, store: true });
|
||||||
this._urlMarks = storage.newMap("url-marks", { privateData: true, replacer: replacer, store: true });
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isArray(Iterator(this._localMarks).next()[1]))
|
if (isArray(Iterator(this._localMarks).next()[1]))
|
||||||
|
|||||||
@@ -846,6 +846,8 @@ var Completion = Module("completion", {
|
|||||||
get setFunctionCompleter() JavaScript.setCompleter, // Backward compatibility
|
get setFunctionCompleter() JavaScript.setCompleter, // Backward compatibility
|
||||||
|
|
||||||
Local: function (dactyl, modules, window) ({
|
Local: function (dactyl, modules, window) ({
|
||||||
|
urlCompleters: {},
|
||||||
|
|
||||||
get options() modules.options,
|
get options() modules.options,
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
@@ -923,8 +925,6 @@ var Completion = Module("completion", {
|
|||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
urlCompleters: {},
|
|
||||||
|
|
||||||
addUrlCompleter: function addUrlCompleter(opt) {
|
addUrlCompleter: function addUrlCompleter(opt) {
|
||||||
let completer = Completion.UrlCompleter.apply(null, Array.slice(arguments));
|
let completer = Completion.UrlCompleter.apply(null, Array.slice(arguments));
|
||||||
completer.args = Array.slice(arguments, completer.length);
|
completer.args = Array.slice(arguments, completer.length);
|
||||||
|
|||||||
@@ -264,6 +264,9 @@ var Storage = Module("Storage", {
|
|||||||
return this._privateMode = Boolean(val);
|
return this._privateMode = Boolean(val);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
Replacer: {
|
||||||
|
skipXpcom: function skipXpcom(key, val) val instanceof Ci.nsISupports ? null : val
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
init: function init(dactyl, modules) {
|
init: function init(dactyl, modules) {
|
||||||
init.superapply(this, arguments);
|
init.superapply(this, arguments);
|
||||||
|
|||||||
@@ -294,7 +294,10 @@ var Config = Module("config", ConfigBase, {
|
|||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.compare = CompletionContext.Sort.unsorted;
|
context.compare = CompletionContext.Sort.unsorted;
|
||||||
context.filterFunc = null;
|
context.filterFunc = null;
|
||||||
context.hasItems = context.completions.length > 0; // XXX
|
|
||||||
|
let words = context.filter.toLowerCase().split(/\s+/g);
|
||||||
|
context.completions = context.completions.filter(function ({ url, title })
|
||||||
|
words.every(function (w) (url + " " + title).toLowerCase().indexOf(w) >= 0))
|
||||||
context.incomplete = true;
|
context.incomplete = true;
|
||||||
|
|
||||||
context.format = modules.bookmarks.format;
|
context.format = modules.bookmarks.format;
|
||||||
|
|||||||
Reference in New Issue
Block a user