mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 12:45:17 -07:00
fix(lsp): check if inlay hints are enabled for a buffer before disabling (#24074)
disabling before enabling throws an error otherwise, because bufstate[bufnr] doesn't exist
This commit is contained in:
parent
64f2691a98
commit
d3e0352574
@ -207,9 +207,11 @@ end
|
||||
---@private
|
||||
function M.disable(bufnr)
|
||||
bufnr = resolve_bufnr(bufnr)
|
||||
clear(bufnr)
|
||||
bufstates[bufnr].enabled = nil
|
||||
bufstates[bufnr].timer = nil
|
||||
if bufstates[bufnr] and bufstates[bufnr].enabled then
|
||||
clear(bufnr)
|
||||
bufstates[bufnr].enabled = nil
|
||||
bufstates[bufnr].timer = nil
|
||||
end
|
||||
end
|
||||
|
||||
--- Toggle inlay hints for a buffer
|
||||
|
Loading…
Reference in New Issue
Block a user