1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-02 23:04:13 +01:00

Fix substring computation issue.

--HG--
extra : rebase_source : b08420e6071d7a574503bc5671e09230a4c9c08a
This commit is contained in:
Kris Maglione
2011-10-03 15:04:30 -04:00
parent a6ee2e4c0c
commit fd612fab8d

View File

@@ -554,9 +554,10 @@ var CompletionContext = Class("CompletionContext", {
// item's text.
let len = substring.length;
let i = 0, n = len;
let result = item.result;
while (n) {
let m = Math.floor(n / 2);
let keep = compare(fixCase(item.text), substring.substring(0, i + m));
let keep = i + m && compare(fixCase(result), substring.substring(0, i + m));
if (!keep)
len = i + m - 1;
if (!keep || m == 0)