Closed soifou closed 2 years ago
I can't reproduce. Please use the mini.lua template.
You can add log.error()
or print(vim.inspect())
to debug yourself.
Sorry for the template, I thought providing one embedding all in /tmp would be more reproductible.
I tried to debug myself but I don't understand why vim.api.nvim_buf_get_keymap
return no rhs for my mapping
if capabilities.hoverProvider then
keymap.set("n", "<CR>", lsp.buf.hover, { buffer = bufnr, desc = "LSP Hover" })
end
:verbose map <CR>
n <CR> *@<Lua function 611>
LSP Hover
Last set from Lua
Press ENTER or type command to continue
:lua = vim.api.nvim_buf_get_keymap(vim.api.nvim_get_current_buf(), 'n')
{ {
buffer = 10,
callback = <function 1>,
desc = "LSP Hover",
expr = 0,
lhs = "<CR>",
lnum = 0,
mode = "n",
noremap = 1,
nowait = 0,
script = 0,
sid = -8,
silent = 0
}, {
...
Thanks, callback
is lua ref. Fixed now
Neovim version (nvim -v | head -n1)
NVIM v0.8.0-dev+595-g95c65a6b2
Operating system/version
Debian testing
How to reproduce the issue
cat mini.lua
nvim -nu mini.lua mini.lua
Expected behavior
I can map
vim.lsp.buf.hover
to<CR>
with no exception thrown when leaving a fold preview. My mapping should be preserved after leaving the preview.Actual behavior
An exception is thrown each time we leave a folded code preview
The current mapping to
vim.lsp.buf.hover
is lost.Note that using the recommended mapping
K
forvim.lsp.buf.hover
fix the issue described.Some additional notes, commit
27c466886959fad03a09dd62814e126ff8178a1a
introduce this issue and replacingk.lhs
byk.rhs
on this line seems to fix the exception but the mapping is still lost.Not related but thank you for your very nice plugin :)