mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-17 03:33:31 +01:00
Fix some non-working 'autocomplete' uses.
This commit is contained in:
@@ -708,6 +708,9 @@ var Bookmarks = Module("bookmarks", {
|
|||||||
ctxt.compare = CompletionContext.Sort.unsorted;
|
ctxt.compare = CompletionContext.Sort.unsorted;
|
||||||
ctxt.filterFunc = null;
|
ctxt.filterFunc = null;
|
||||||
|
|
||||||
|
if (ctxt.waitingForTab)
|
||||||
|
return;
|
||||||
|
|
||||||
let words = ctxt.filter.toLowerCase().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));
|
||||||
|
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ var CompletionContext = Class("CompletionContext", {
|
|||||||
this._cache.offset = this.offset;
|
this._cache.offset = this.offset;
|
||||||
this.lastActivated = this.top.runCount;
|
this.lastActivated = this.top.runCount;
|
||||||
}
|
}
|
||||||
if (!this.itemCache[this.key]) {
|
if (!this.itemCache[this.key] && !this.waitingForTab) {
|
||||||
try {
|
try {
|
||||||
let res = this._generate();
|
let res = this._generate();
|
||||||
if (res != null)
|
if (res != null)
|
||||||
@@ -1017,7 +1017,6 @@ var Completion = Module("completion", {
|
|||||||
context.hasItems = true;
|
context.hasItems = true;
|
||||||
context.completions = context.completions.filter(function ({ url, title })
|
context.completions = context.completions.filter(function ({ url, title })
|
||||||
words.every(function (w) (url + " " + title).toLowerCase().indexOf(w) >= 0))
|
words.every(function (w) (url + " " + title).toLowerCase().indexOf(w) >= 0))
|
||||||
context.incomplete = true;
|
|
||||||
|
|
||||||
context.format = this.modules.bookmarks.format;
|
context.format = this.modules.bookmarks.format;
|
||||||
context.keys.extra = function (item) {
|
context.keys.extra = function (item) {
|
||||||
@@ -1036,20 +1035,24 @@ var Completion = Module("completion", {
|
|||||||
running[provider] = false;
|
running[provider] = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
service.startSearch(context.filter, "", context.result, {
|
if (!context.waitingForTab) {
|
||||||
onSearchResult: util.wrapCallback(function onSearchResult(search, result) {
|
context.incomplete = true;
|
||||||
if (result.searchResult <= result.RESULT_SUCCESS)
|
|
||||||
running[provider] = null;
|
|
||||||
|
|
||||||
context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING;
|
service.startSearch(context.filter, "", context.result, {
|
||||||
context.completions = [
|
onSearchResult: util.wrapCallback(function onSearchResult(search, result) {
|
||||||
{ url: result.getValueAt(i), title: result.getCommentAt(i), icon: result.getImageAt(i) }
|
if (result.searchResult <= result.RESULT_SUCCESS)
|
||||||
for (i in util.range(0, result.matchCount))
|
running[provider] = null;
|
||||||
];
|
|
||||||
}),
|
context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING;
|
||||||
get onUpdateSearchResult() this.onSearchResult
|
context.completions = [
|
||||||
});
|
{ url: result.getValueAt(i), title: result.getCommentAt(i), icon: result.getImageAt(i) }
|
||||||
running[provider] = true;
|
for (i in util.range(0, result.matchCount))
|
||||||
|
];
|
||||||
|
}),
|
||||||
|
get onUpdateSearchResult() this.onSearchResult
|
||||||
|
});
|
||||||
|
running[provider] = true;
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
urls: function (context, tags) {
|
urls: function (context, tags) {
|
||||||
|
|||||||
Reference in New Issue
Block a user