Skip to content
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

How to properly abort a command using the escape key? #40

Open
digitalmaster opened this issue Jun 24, 2024 · 0 comments
Open

How to properly abort a command using the escape key? #40

digitalmaster opened this issue Jun 24, 2024 · 0 comments

Comments

@digitalmaster
Copy link

I'm trying to figure out how to get my escape key to reliably get me back to the initial state (normal mode, canceled any ongoing key chords).

The issue i'm facing now is that if I start typing a command like vi and decide that I no longer want to complete this sequence, hitting escape gets me out of visual mode but it doesn't abort the ongoing key chord.

I've looked through docs and examples but haven't been able to find a way to do this yet. Curious if there's an obvious way to do this?

Sidenote: The first issue I had with the escape key is that sometimes I had to press it multiple times to get back normal mode. I thought this a was a bug but then realized it was only happening when there was a suggestion visible. So first press would dismiss the suggestion, second press would put me back into normal mode. The escape key binding confirmed this behavior:

{
    "key": "escape",
    "command": "modaledit.enterNormal",
    "when": "editorTextFocus && !suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},

Once I realized that I just hit escape until I get the normal mode block cursor which works well for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant