in BinSearch.equalOrMore and BinSearch.equalOrLess, return ~1 if no item is found, for the sake of less ambiguity in usage. Functions that call these have also been adapted.

This commit is contained in:
2025-09-13 02:18:14 +01:00
parent 53a4265b07
commit 20a542df29
6 changed files with 17 additions and 7 deletions

View File

@@ -29,7 +29,10 @@ struct
Utils.getRelativeLineStartFromRightHead (startLine, curLine, lhd)
(* get absolute idx of line *)
val absIdx = curIdx + strPos
val searchPos = BinSearch.equalOrMore (absIdx, searchList)
val searchPos =
if searchPos = ~1 then Vector.length searchList else searchPos
val env = Utils.initEnv
( windowWidth