mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-10 11:55:45 +01:00
Fix substring computation issue.
--HG-- extra : rebase_source : b08420e6071d7a574503bc5671e09230a4c9c08a
This commit is contained in:
@@ -554,9 +554,10 @@ var CompletionContext = Class("CompletionContext", {
|
|||||||
// item's text.
|
// item's text.
|
||||||
let len = substring.length;
|
let len = substring.length;
|
||||||
let i = 0, n = len;
|
let i = 0, n = len;
|
||||||
|
let result = item.result;
|
||||||
while (n) {
|
while (n) {
|
||||||
let m = Math.floor(n / 2);
|
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)
|
if (!keep)
|
||||||
len = i + m - 1;
|
len = i + m - 1;
|
||||||
if (!keep || m == 0)
|
if (!keep || m == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user