commit b4599acbf8e30aa1234bc4041546f960dcc3a238
parent 05d9e6a9e850ee797a4a018e72156dd62831a4b6
Author: notomo <18519692+notomo@users.noreply.github.com>
Date: Thu, 31 Oct 2024 00:57:33 +0900
fix(lsp): correct hover result handling (#30995)
Problem: vim.lsp.buf.hover() displays "No information available" when client_id
is not 1.
Solution: use vim.tbl_isempty(tbl) instead of #tbl==0
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
@@ -53,7 +53,7 @@ function M.hover(config)
end
end
- if #results1 == 0 then
+ if vim.tbl_isempty(results1) then
if config.silent ~= true then
vim.notify('No information available')
end