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

Catch keyboard interrupt and handle it as Escape #33

Closed
itmecho opened this issue Apr 30, 2021 · 3 comments
Closed

Catch keyboard interrupt and handle it as Escape #33

itmecho opened this issue Apr 30, 2021 · 3 comments

Comments

@itmecho
Copy link

itmecho commented Apr 30, 2021

First off, great plugin!

Sometimes out of habit, I hit <c-c> to cancel. When I do it with which-key, I get the following error:
image

It then takes me back to my previous window but leaves the which-key panel open. I can't switch back to the which-key panel to close it, the only way is to trigger it again and then exit it properly with escape.

It would be nice if which key handled <c-c> in the same way as escape

folke added a commit that referenced this issue Apr 30, 2021
@folke
Copy link
Owner

folke commented Apr 30, 2021

Added!

@itmecho
Copy link
Author

itmecho commented Apr 30, 2021

Amazing! Works perfectly

@boltlessengineer
Copy link

I’m facing similar issue when I pressed Ctrl-C

E5108: Error executing lua Keyboard interrupt
stack traceback:
        [C]: in function 'getchar'
        ...al/share/nvim/lazy/which-key.nvim/lua/which-key/view.lua:96: in function 'read_pending'
        ...al/share/nvim/lazy/which-key.nvim/lua/which-key/view.lua:281: in function 'on_keys'
        ...al/share/nvim/lazy/which-key.nvim/lua/which-key/view.lua:255: in function 'open'
        ...al/share/nvim/lazy/which-key.nvim/lua/which-key/init.lua:49: in function 'show'
        [string ":lua"]:1: in main chunk

Is this also fixable?

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

3 participants