add another test for 'df<char>' motion, checking that we leave a newline behind if the whole buffer is deleted

This commit is contained in:
2025-10-18 14:29:20 +01:00
parent 5d00da2cbb
commit bc44c7bcd0
2 changed files with 21 additions and 0 deletions

View File

@@ -728,6 +728,9 @@ struct
val initialMsg = Fn.initMsgs (cursorIdx, length, buffer)
val buffer = LineGap.delete (cursorIdx, length, buffer)
val buffer =
if #textLength buffer = 0 then LineGap.fromString "\n" else buffer
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val cursorIdx =
if Cursor.isOnNewlineAfterChr (buffer, cursorIdx) then cursorIdx - 1