Closed smjonas closed 2 years ago
Interesting... continuing the discussion here this seems like even more of a niche problem than I thought; this only happens when you use <C-c>
to terminate the input, as opposed to <Esc>
(which I normally use).
I think this is just the way Neovim's vim.fn.input
/ vim.ui.input
work in general: cancelling normally, i.e. by closing the command line (I mapped this to ii
, works with <esc>
by default) returns nil
as an input. However, <C-c>
as a keyboard interrupt is somehow considered an error. Maybe this behavior should be changed in Neovim / Vim itself.
While I agree, I don't think that's going to be changed anytime soon for parity reasons with Vim haha, as vim.fn.input()
is just an internal call to VimL's input()
(to my knowledge).
Edit: vim.ui.input()
is something completely different, which cannot be used for other reasons (namely, it's asynchronous nature).
Checklist
main
branch?:h nvim-surround
to see if there might be any relevant information there?Describe the bug When cancelling the
vim.ui.input
prompt, any created highlights will not be cleared and stay permanently in the buffer.To Reproduce
ysiwT
.<C-c>
.Expected behavior The highlight should be cleared.
Additional context None