1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-21 08:25:48 +01:00

remove flicker when using wop=auto completions and cpt=l; Note: typing after hitting O (or any other long url) is (still) kinda slow, we should try to improve this corner case.

This commit is contained in:
Martin Stubenschrott
2008-11-21 10:33:47 +00:00
parent d4ef9cee7a
commit 52038db7ae
2 changed files with 8 additions and 13 deletions

View File

@@ -58,11 +58,6 @@ function Completion() //{{{
var completionCache = [];
var historyTimer = new util.Timer(50, 100, function histTimer() {
// don't set all completions again every time the timer fires, even
// though items might not have changed
if (historyCache.length == historyResult.matchCount)
return;
let comp = [];
for (let i in util.range(0, historyResult.matchCount))
comp.push([historyResult.getValueAt(i),
@@ -73,7 +68,8 @@ function Completion() //{{{
// TODO: we need to have a "completionCacheAfter" to allow cpt=slf
historyCache = comp;
commandline.setCompletions({ get items() { return completionCache.concat(historyCache); } });
commandline.setCompletions({ get items() completionCache.concat(historyCache),
incompleteResult: historyResult.searchResult >= historyResult.RESULT_NOMATCH_ONGOING ? true : false });
});
function Javascript()
@@ -1319,7 +1315,8 @@ function Completion() //{{{
}
}
return { start: start, items: completions, getMoreItems: getMoreItems };
// TODO: incomplete result should be set conditionally
return { start: start, items: completions, getMoreItems: getMoreItems, incompleteResult: true };
},
userCommand: function userCommand(filter)