Skip to content
Snippets Groups Projects
Commit e516b1c0 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[searchcursor addon] Fix bug in binary search in adjustPos

Issue #4839
parent 6892031f
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@
var mid = (min + max) >> 1
var len = foldFunc(orig.slice(0, mid)).length
if (len == pos) return mid
else if (len > pos) max = mid - 1
else if (len > pos) max = mid
else min = mid + 1
}
}
......
......@@ -77,8 +77,9 @@
test("normalize", function() {
if (!String.prototype.normalize) return
var doc = new CodeMirror.Doc("yılbaşı\n수 있을까")
var doc = new CodeMirror.Doc("yılbaşı\n수 있을까\nLe taux d'humidité à London")
run(doc, "s", false, 0, 5, 0, 6)
run(doc, "", false, 1, 2, 1, 3)
run(doc, "a", false, 0, 4, 0, 5, 2, 4, 2, 5, 2, 19, 2, 20)
})
})();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment