port over bug fixes from mutually recursive functions from test-builder-with-cursor.sml to text-builder-with-highlight.sml

This commit is contained in:
2025-09-13 03:02:13 +01:00
parent 916e94eaaa
commit a3b00e09d8
2 changed files with 125 additions and 12 deletions

View File

@@ -58,9 +58,9 @@ struct
else
(* bin search lines *)
let
val searchPos = BinSearch.equalOrMore (pos + 1, line)
val linePos = BinSearch.equalOrMore (pos + 1, line)
in
if searchPos = ~1 then
if linePos = ~1 then
(* next line is not in this node *)
let
val absIdx = absIdx - pos
@@ -71,7 +71,7 @@ struct
end
else
let
val lineOffset = Vector.sub (line, searchPos)
val lineOffset = Vector.sub (line, linePos)
val newStrPos = lineOffset + 1
val absIdx = absIdx - pos + newStrPos
val posY = posY + TC.ySpace