fix: close completion window on ctrl+c in insert mode #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As a nvim-cmp user, I was used to close the completion window with ctrl+c (it's kind of muscle memory at this point).
So I wanted to add the ability to blink.cmp too. Before this PR, the completion would not be closed as C-c does not trigger the InsertLeave autocommand in Vim/Nvim.
Currently, it looks like this:

Notice that my cursor is on line 13, outside of the completion window after I pressed ctrl+c.
For reference, nvim-cmp does something similar here:
https://github.com/hrsh7th/nvim-cmp/blob/ae644feb7b67bf1ce4260c231d1d4300b19c6f30/plugin/cmp.lua#L43-L54