vim.fn.maparg now can return mappings that have no rhs (and instead are a lua callback).
Given a mapping to e.g. <CR>, this makes abbreviation expansion raise errors as it tries to reset a mapping which vim.fn.maparg doesn't know how to deal with.
We need to instead use vim.api.nvim_buf_get_keymap, which is slightly clunky (and returns all mappings rather than mappings for just a specific key), but which will return a table with callback (the lua callback) for mappings that don't have RHSs.
vim.fn.maparg
now can return mappings that have norhs
(and instead are a lua callback).Given a mapping to e.g.
<CR>
, this makes abbreviation expansion raise errors as it tries to reset a mapping whichvim.fn.maparg
doesn't know how to deal with.We need to instead use
vim.api.nvim_buf_get_keymap
, which is slightly clunky (and returns all mappings rather than mappings for just a specific key), but which will return a table withcallback
(the lua callback) for mappings that don't have RHSs.