diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 05fa9b57..195bee66 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -708,6 +708,9 @@ var Bookmarks = Module("bookmarks", { ctxt.compare = CompletionContext.Sort.unsorted; ctxt.filterFunc = null; + if (ctxt.waitingForTab) + return; + let words = ctxt.filter.toLowerCase().split(/\s+/g); ctxt.completions = ctxt.completions.filter(function (i) words.every(function (w) i.toLowerCase().indexOf(w) >= 0)); diff --git a/common/modules/completion.jsm b/common/modules/completion.jsm index c0cba3ae..807d8ce7 100644 --- a/common/modules/completion.jsm +++ b/common/modules/completion.jsm @@ -412,7 +412,7 @@ var CompletionContext = Class("CompletionContext", { this._cache.offset = this.offset; this.lastActivated = this.top.runCount; } - if (!this.itemCache[this.key]) { + if (!this.itemCache[this.key] && !this.waitingForTab) { try { let res = this._generate(); if (res != null) @@ -1017,7 +1017,6 @@ var Completion = Module("completion", { context.hasItems = true; context.completions = context.completions.filter(function ({ url, title }) words.every(function (w) (url + " " + title).toLowerCase().indexOf(w) >= 0)) - context.incomplete = true; context.format = this.modules.bookmarks.format; context.keys.extra = function (item) { @@ -1036,20 +1035,24 @@ var Completion = Module("completion", { running[provider] = false; }; - service.startSearch(context.filter, "", context.result, { - onSearchResult: util.wrapCallback(function onSearchResult(search, result) { - if (result.searchResult <= result.RESULT_SUCCESS) - running[provider] = null; + if (!context.waitingForTab) { + context.incomplete = true; - context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; - context.completions = [ - { url: result.getValueAt(i), title: result.getCommentAt(i), icon: result.getImageAt(i) } - for (i in util.range(0, result.matchCount)) - ]; - }), - get onUpdateSearchResult() this.onSearchResult - }); - running[provider] = true; + service.startSearch(context.filter, "", context.result, { + onSearchResult: util.wrapCallback(function onSearchResult(search, result) { + if (result.searchResult <= result.RESULT_SUCCESS) + running[provider] = null; + + context.incomplete = result.searchResult >= result.RESULT_NOMATCH_ONGOING; + context.completions = [ + { url: result.getValueAt(i), title: result.getCommentAt(i), icon: result.getImageAt(i) } + for (i in util.range(0, result.matchCount)) + ]; + }), + get onUpdateSearchResult() this.onSearchResult + }); + running[provider] = true; + } }), urls: function (context, tags) {