which-key.nvim
which-key.nvim copied to clipboard
Issue with cmdline-mode mappings that use <C-\>e on the RHS
When triggering a cmdline-mode mapping created with WhichKey that uses <C-\>e on the RHS, I get the error E488: Trailing characters. Creating the same mapping with vim.api.nvim_set_keymap works just fine.
For reference, <C-\>e allows a mapping to manipulate the command line - see :h c_CTRL-\_e
-- This works
vim.api.nvim_set_keymap('c', '<C-k>', [[<C-\>e(" ".getcmdline())[:getcmdpos()-1][1:]<Cr>]], { noremap = true })
-- This doesn't work
require'which-key'.register({
['<C-k>'] = { [[<C-\>e(" ".getcmdline())[:getcmdpos()-1][1:]<Cr>]], "Kill to end of line" }
}, { mode = 'c', noremap = true })