fix bug with ViDlrDfa.next: we previously did not consider the case of cursor starts on a line containing nothing but a blank \n newline. We consider this now, returning the same index when it occurs.

This commit is contained in:
2025-09-07 20:59:13 +01:00
parent b7e0bab04a
commit 11212430f4

View File

@@ -30,7 +30,15 @@ struct
val isFinal = isFinal
end)
val fStart = Folder.foldNext
fun fStart (idx, absIdx, str, tl, currentState, counter) =
if String.sub (str, idx) = #"\n" then
if counter = 1 then
absIdx
else
Folder.foldNext
(idx + 1, absIdx + 1, str, tl, currentState, counter - 1)
else
Folder.foldNext (idx, absIdx, str, tl, currentState, counter)
end)
structure ViDlrForDelete =