nvim: lsp: Inlay hints API has changed

With the recent change to the API, without passing buffer number as
0 for the current buffer, inlay hints gets enabled for all buffers.
This commit is contained in:
Sanchayan Maity 2024-05-03 11:44:05 +05:30
parent 65e5721a5a
commit 420d643338
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -16,7 +16,10 @@ local peek_definition = function()
end end
local inlay_hint_toggle = function() local inlay_hint_toggle = function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) local filter = { bufnr = 0 }
local enabled = vim.lsp.inlay_hint.is_enabled(filter)
vim.lsp.inlay_hint.enable(not enabled, filter)
end end
_G.InlayHintToggle = inlay_hint_toggle _G.InlayHintToggle = inlay_hint_toggle