From 9369bbed930e734c7d2dcbdc9014874dbd58cf26 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Sat, 6 Sep 2025 01:40:32 +0100 Subject: [PATCH] in normal mode, when we receive an event which we don't want to handle (like enter), we clear the app's mode and command history instead of simply returning the same app unmodified. This fixes a bug: say we pres 'f' to go to a character and then press enter. Before this commit, pressing a character after that 'enter' will go to that character. This is contrary to Vim, which resets the command history on an invalid command, and now we reset the command history too. --- fcore/normal-mode/normal-mode.sml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fcore/normal-mode/normal-mode.sml b/fcore/normal-mode/normal-mode.sml index 013ba4f..b9009ea 100644 --- a/fcore/normal-mode/normal-mode.sml +++ b/fcore/normal-mode/normal-mode.sml @@ -401,10 +401,10 @@ struct * is also possible through other keys, * and it is better to use those othe keys to encourage * staying on the home row. *) - | KEY_ENTER => app - | KEY_BACKSPACE => app - | ARROW_RIGHT => app - | ARROW_LEFT => app - | ARROW_UP => app - | ARROW_DOWN => app + | KEY_ENTER => NormalFinish.clearMode app + | KEY_BACKSPACE => NormalFinish.clearMode app + | ARROW_RIGHT => NormalFinish.clearMode app + | ARROW_LEFT => NormalFinish.clearMode app + | ARROW_UP => NormalFinish.clearMode app + | ARROW_DOWN => NormalFinish.clearMode app end