found bug in '0' motion, added test for it, and fixed it as well

This commit is contained in:
2025-09-23 16:05:23 +01:00
parent 9a15b1715a
commit 51a7c358ca
2 changed files with 28 additions and 5 deletions

View File

@@ -28,8 +28,8 @@ struct
val textLength = #textLength buffer
val newCursorIdx = Fn.fMove (buffer, cursorIdx)
in
if newCursorIdx >= textLength - 2 then
let val newCursorIdx = Int.max (textLength - 2, 0)
if newCursorIdx >= textLength - 1 then
let val newCursorIdx = Int.max (textLength - 1, 0)
in finish (app, buffer, newCursorIdx)
end
else