diff --git a/fcore/normal-mode/normal-mode.sml b/fcore/normal-mode/normal-mode.sml index 3e772f0..9532c59 100644 --- a/fcore/normal-mode/normal-mode.sml +++ b/fcore/normal-mode/normal-mode.sml @@ -462,6 +462,7 @@ struct fun parseYankTerminal (str, count, app, chrCmd, time) = case chrCmd of #"h" => NormalYank.yankLeft (app, count) + | #"l" => NormalYank.yankRight (app, count) | #"y" => NormalYank.yankLine (app, count) | #"0" => NormalYank.yankToStartOfLine app | #"w" => NormalYank.yankWhenMovingForward (app, Cursor.nextWord, count) diff --git a/fcore/normal-mode/normal-yank.sml b/fcore/normal-mode/normal-yank.sml index 4253e9b..4541c02 100644 --- a/fcore/normal-mode/normal-yank.sml +++ b/fcore/normal-mode/normal-yank.sml @@ -33,9 +33,9 @@ struct val buffer = LineGap.goToIdx (cursorIdx, buffer) - val max = Cursor.viDlr (buffer, cursorIdx, 1) + val endOfLineIdx = Cursor.viDlr (buffer, cursorIdx, 1) val high = Cursor.viL (buffer, cursorIdx, count) - val high = Int.max (high, max) + val high = Int.min (high, endOfLineIdx) val length = high - cursorIdx val buffer = LineGap.goToIdx (high, buffer)