mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-16 12:24:36 +02:00
fix(util.toggle): correctly toggle inlay_hints
(#3202)
`is_enabled` also accepts a `filter` and when we initially toggle `inlay_hints` on [here](735f5905f8/lua/lazyvim/plugins/lsp/init.lua (L153)
), we pass a `bufnr` which sets the `inlay_hints` in the `bufstate` (see [here](42aa69b076/runtime/lua/vim/lsp/inlay_hint.lua (L407-L432)
)), but when we call `is_enabled` without a filter table the returned result if from the `globalstate` (see [here](42aa69b076/runtime/lua/vim/lsp/inlay_hint.lua (L376-L388)
)).
This commit is contained in:
parent
735f5905f8
commit
23374f160a
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ function M.inlay_hints(buf, value)
|
|||
ih(buf, value)
|
||||
elseif type(ih) == "table" and ih.enable then
|
||||
if value == nil then
|
||||
value = not ih.is_enabled(buf)
|
||||
value = not ih.is_enabled({ bufnr = buf or 0 })
|
||||
end
|
||||
ih.enable(value, { bufnr = buf })
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue