-
Notifications
You must be signed in to change notification settings - Fork 521
vim: escape key should always immediately exit input mode #4716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@akshayka this commit (as included in marimo 0.13.3) does not fix this issue. If you have both an LSP and an AI completion/suggestion presented then the escape only closes the AI suggestion and still leaves you in input mode. |
Thanks, sorry about that. I only tested with LSP. I've reopened and marked as a good first issue for those looking to contribute. |
@bulletmark - we'd love your help / expertise on this, so we can avoid the back and forth. happy to pair on this with you, but I don't use vim so I don't quite know what correct looks like. |
@mscolnick, simply, when using vim mode and you press escape, you should always immediately exit input mode. Prior to marimo 0.13.3, if you have any completion/suggestion presented then pressing escape would just remove that completion/suggestion but erroneously leave you still in input mode. @akshayka changed it in 0.3.13 so that escape also exits input mode, but this only works if either a single LSP (completion) or AI (suggestion) is presented. The current bug in 0.13.3 (and 0.13.4) is that if BOTH are presented then escape clears both the completion and suggestion but still leaves you in input mode. From @akshayka 's response above I am pretty sure he understands this issue. BTW, I tested all these scenarios in vim, neovim, vscode+vim, zed+vim, and pycharm+vim and they all work correctly. They clear both the LSP completion and AI suggestion and also immediately exit input mode. I've just lived with this bug and only bothered to write up this issue when I saw that discord post from another vim user complaining about input/normal mode switching. It would be really handy if the next developer you guys employ is a vim user! |
My description of this problem is wrong. Escape fails to vim exit input mode whenever an AI suggestion is displayed, regardless of whether an LSP completion is displayed or not. So it seems 0.13.3 fixed the problem for LSP completions, and now marimo (currently = 0.13.6) just needs fixing for AI suggestions. |
If a completion/suggestion popup appears when entering text using vim mode in Marimo, then the first escape just clears the suggestion and stays in insert mode. Sometimes. due to timing, you may barely notice the popup just before you press escape so the user assumes he is in normal mode, but marimo leaves him in insert mode which is a bad user experience.
In vim mode, escape should not be recognized to clear completion/suggestion hints. Escape should always just immediately exit insert mode. Any pending completion/suggestion should just be ignored. This is how vim, neovim, vscode+vim, zed+vim, and pycharm+vim all work.
Refer also this discussion.
Environment
Code to reproduce
No response
The text was updated successfully, but these errors were encountered: