adjust functor to move by dfa so that we cannot go to the last char of the file if (last char is a newline and is preceded by a non-newline), but otherwise we can go to the last char of the file.

This commit is contained in:
2025-09-23 11:47:25 +01:00
parent 5fded45303
commit 5d20b81bcc
2 changed files with 24 additions and 5 deletions

View File

@@ -737,4 +737,9 @@ struct
end
| [] => true
end
(* Prerequisite: lineGap is moved to cursorIdx *)
fun isOnNewlineAfterChr (buffer, cursorIdx) =
cursorIdx > 0 andalso not (isPrevChrStartOfLine (buffer, cursorIdx))
andalso isCursorAtStartOfLine (buffer, cursorIdx)
end