do not use 'clearMode' in helpDeleteChr function, because we have 'buffer' and 'cursorIdx' parameters we would like to add to the app state before exiting the loop. Instead, go to end of loop by passing 'count' of 0

This commit is contained in:
2024-11-08 04:25:33 +00:00
parent 36763fce94
commit ff38e39deb
2 changed files with 4 additions and 3 deletions

View File

@@ -268,10 +268,11 @@ struct
in in
if nextIsEnd andalso cursorIsStart then if nextIsEnd andalso cursorIsStart then
(* vi simply doesn't do anything on 'x' command (* vi simply doesn't do anything on 'x' command
* when cursor is at start of line, and next chr is line break *) * when cursor is at start of line, and next chr is line break
clearMode app * so skip to end of loop by passing count of 0 *)
helpDeleteChr (app, buffer, cursorIdx, 0)
else if cursorIsStart then else if cursorIsStart then
clearMode app helpDeleteChr (app, buffer, cursorIdx, 0)
else if nextIsEnd then else if nextIsEnd then
let let
(* delete char at cursor and then decrement cursorIdx by 1 (* delete char at cursor and then decrement cursorIdx by 1

BIN
shf

Binary file not shown.