From d60e8bf7aafd7316d6a84497d6a973ccb10ec147 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sun, 23 Nov 2025 23:44:24 +0000 Subject: [PATCH] add todo note to implement yh/yj/yk/yl motions (yank according to h/j/k/l motions) --- fcore/normal-mode/normal-mode.sml | 14 ++++++++++++-- todo.md | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/fcore/normal-mode/normal-mode.sml b/fcore/normal-mode/normal-mode.sml index 33e119c..3264a91 100644 --- a/fcore/normal-mode/normal-mode.sml +++ b/fcore/normal-mode/normal-mode.sml @@ -580,7 +580,17 @@ struct structure LeftArrow = struct fun parseLeftArrowCommand (strPos, str, count, app, time) = - raise Fail "unimplemented" + case String.sub (str, strPos) of + #"y" => + if strPos + 1 = String.size str then + (* terminal command, so simple yank *) + raise Fail "left-arrow-yank unimplemnted" + else + (case String.sub (str, strPos + 1) of + #"d" => NormalYankDelete.deleteCharsLeft (app, count, time) + | _ => NormalFinish.clearMode app) + | #"d" => NormalDelete.deleteCharsLeft (app, count, time) + | _ => NormalFinish.clearMode app fun parse (app, str, time) = if String.size str = 0 then @@ -588,7 +598,7 @@ struct else if String.size str = 1 then case Int.fromString str of SOME count => MoveViH.move (app, count) - | NONE => parseLeftArrowCommand (0, app, str, 1, time) + | NONE => parseLeftArrowCommand (0, str, 1, app, time) else let val numLength = getNumLength (0, str) diff --git a/todo.md b/todo.md index c86f813..8a17f13 100644 --- a/todo.md +++ b/todo.md @@ -11,3 +11,5 @@ - Add tests for both Afterwards, add tests for yanking. + + Add yank commands like yh/yj/yk/yl as well and test them too.