diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index bd315098ab..931649a828 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -375,7 +375,7 @@ local function reset_defaults(bufnr) end api.nvim_buf_call(bufnr, function() local keymap = vim.fn.maparg('K', 'n', false, true) - if keymap and keymap.callback == vim.lsp.buf.hover then + if keymap and keymap.callback == vim.lsp.buf.hover and keymap.buffer == 1 then vim.keymap.del('n', 'K', { buffer = bufnr }) end end)