implemented 'yh' motion (yank left)

This commit is contained in:
2026-01-05 10:39:42 +00:00
parent d2f32c1512
commit adb8757ed8
3 changed files with 22 additions and 6 deletions

View File

@@ -4,6 +4,24 @@ struct
open DrawMsg
open MailboxType
fun yankLeft (app: app_type, count) =
let
val {buffer, cursorIdx, ...} = app
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val min = Cursor.vi0 (buffer, cursorIdx)
val low = Cursor.viH (buffer, cursorIdx, 1)
val low = Int.max (min, low)
val length = cursorIdx - low
val str = LineGap.substring (low, length, buffer)
val msg = YANK str
val mode = NORMAL_MODE ""
in
NormalModeWith.modeAndBuffer (app, buffer, mode, [DRAW msg])
end
fun yankLine (app: app_type, count) =
let
val {buffer, cursorIdx, ...} = app