Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 3ad9c31

Browse files
committed
fix: weird behavior of hover
1 parent 78a4534 commit 3ad9c31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/completion/hover.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ local fancy_floating_markdown = function(contents, opts)
243243
end
244244

245245
local callback = 'textDocument/hover'
246-
local default_callback = vim.lsp.callbacks[callback]
246+
M.default_callback = vim.lsp.callbacks[callback]
247247

248248
local function callback_function(_, method, result)
249249
-- if M.winnr ~= nil and api.nvim_win_is_valid(M.winnr) then
@@ -291,13 +291,14 @@ local function callback_function(_, method, result)
291291
return bufnr, winnr
292292
end)
293293
else
294-
default_callback(_, method, result, _)
294+
M.default_callback(_, method, result, _)
295295
end
296296
end
297297

298298
M.autoOpenHoverInPopup = function(manager)
299+
if vim.fn.pumvisible() ~= 1 then return end
299300
for _, client in pairs(vim.lsp.buf_get_clients(0)) do
300-
default_callback = client.config.callbacks['textDocument/hover'] or vim.lsp.callbacks['textDocument/hover']
301+
local default_callback = client.config.callbacks['textDocument/hover'] or vim.lsp.callbacks['textDocument/hover']
301302
if default_callback ~= callback_function then
302303
client.config.callbacks['textDocument/hover'] = callback_function
303304
end

0 commit comments

Comments
 (0)