make 'de', 'dE', 'dj' and 'dk' commands work similarly to vi (details are in comments)

This commit is contained in:
2024-11-14 08:57:31 +00:00
parent cae9f19787
commit f279dc0937
3 changed files with 47 additions and 4 deletions

View File

@@ -1135,6 +1135,15 @@ struct
fun endOfWORD (lineGap, cursorIdx) =
toEndOfWord (lineGap, cursorIdx, helpEndOfWORD)
(* vi's 'e' command takes user last char in word
* but 'de' deletes up to and including last char of word
* So we need to increment by one for deletion. *)
fun endOfWordPlusOne (lineGap, cursorIdx) =
endOfWord (lineGap, cursorIdx) + 1
fun endOfWORDPlusOne (lineGap, cursorIdx) =
endOfWORD (lineGap, cursorIdx) + 1
fun helpFirstNonSpaceChr (strPos, str, absIdx, stl, ltl) =
if strPos = String.size str then
case (stl, ltl) of