add functionality to delete to chr (equivalent of Vi commands starting with 'df' like 'dfe' to delete to the next 'e', and also add equivalent of 'dFe' to delete backwards)

This commit is contained in:
2024-11-09 09:24:14 +00:00
parent faff848cb4
commit 19aaae72f3
2 changed files with 16 additions and 5 deletions

View File

@@ -591,14 +591,25 @@ struct
| RESIZE_EVENT (width, height) =>
resizeText (app, width, height))
| #"d" =>
(* todo: delete whole line *)
(* delete whole line *)
clearMode app
| #"f" =>
(* todo: delete to chr, forwards *)
clearMode app
(case newCmd of
CHAR_EVENT chr =>
deleteToChr (app, count, Cursor.toNextChr, op+, chr)
| KEY_ESC =>
clearMode app
| RESIZE_EVENT (width, height) =>
resizeText (app, width, height))
| #"F" =>
(* todo: delete to chr, backwards *)
clearMode app
(* delete to chr, backwards *)
(case newCmd of
CHAR_EVENT chr =>
deleteToChr (app, count, Cursor.toPrevChr, op-, chr)
| KEY_ESC =>
clearMode app
| RESIZE_EVENT (width, height) =>
resizeText (app, width, height))
| #"g" =>
(* todo: same events as handleGo *)
clearMode app

BIN
shf

Binary file not shown.