1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:48:00 +01:00

made autocompletions not hang the GUI for quick input

This commit is contained in:
Martin Stubenschrott
2008-11-08 15:45:05 +00:00
parent 3e48c58ab3
commit eac34847e5
3 changed files with 15 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
// An eval with a cleaner lexical scope.
// TODO: that shows up in ":echo modules", can we move it "inside" the Completion class? --mst
const EVAL_TMP = "__liberator_eval_tmp";
function __eval(__liberator_eval_arg, __liberator_eval_tmp)
{
@@ -201,6 +202,7 @@ function Completion() //{{{
if (key in cache)
return cache[key];
try
{
return cache[key] = __eval(arg, tmp);
@@ -675,6 +677,13 @@ function Completion() //{{{
return [];
},
// cancel any ongoing search
cancel: function()
{
if (completionService)
completionService.stopSearch();
},
// discard all entries in the 'urls' array, which don't match 'filter
// urls must be of type [["url", "title"], [...]] or optionally
// [["url", "title", keyword, [tags]], [...]]
@@ -1187,6 +1196,7 @@ function Completion() //{{{
else if (c == "l" && completionService) // add completions like Firefox's smart location bar
{
completionService.stopSearch();
//dump("searching for " + filter + "\n");
completionService.startSearch(filter, "", historyResult, {
onSearchResult: function onSearchResult(search, result) {
historyResult = result;