From 7676556513f5e216b9841e1d835becf36d8509c8 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Thu, 16 Oct 2025 12:07:27 +0100 Subject: [PATCH] fix failing test for 'd$' motion, which means completing tests for 'd$' motion too --- fcore/normal-mode/make-normal-delete.sml | 4 ++++ shell/shell.sml | 1 - todo.md | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fcore/normal-mode/make-normal-delete.sml b/fcore/normal-mode/make-normal-delete.sml index 838ae76..17295d7 100644 --- a/fcore/normal-mode/make-normal-delete.sml +++ b/fcore/normal-mode/make-normal-delete.sml @@ -445,6 +445,10 @@ struct * after having performed the deletion. *) val buffer = LineGap.goToIdx (lineStart, buffer) val cursorIdx = Cursor.viDlr (buffer, lineStart, 1) + val buffer = LineGap.goToIdx (cursorIdx, buffer) + val cursorIdx = + if Cursor.isOnNewlineAfterChr (buffer, cursorIdx) then cursorIdx - 1 + else cursorIdx in finishAfterDeletingBuffer (app, cursorIdx, buffer, time, initialMsg) end diff --git a/shell/shell.sml b/shell/shell.sml index 3a96ae3..68413ed 100644 --- a/shell/shell.sml +++ b/shell/shell.sml @@ -84,7 +84,6 @@ struct (* load file intol gap buffer and create initial app *) val io = TextIO.openIn "temp.txt" val lineGap = ioToLineGap (io, LineGap.empty) - val lineGap = LineGap.fromString "hello\nworld" val _ = TextIO.closeIn io val app = AppType.init (lineGap, 1920, 1080, Time.now ()) diff --git a/todo.md b/todo.md index 310fb78..26572a1 100644 --- a/todo.md +++ b/todo.md @@ -1,7 +1,6 @@ # To-do list - Add tests for: - - `d$` - `d^` - `dd` - `dn`