Skip to content

Commit

Permalink
fix(lsp): enable() does not activate inlay hints on open buffers #28629
Browse files Browse the repository at this point in the history
Problem:
inlay_hint `enable(<no args>)` does not activate inlay hints on open
buffers. If a buffer does not have a corresponding `bufstate` in
`bufstates`, then `enable` all buffers will not take effect on it.

Solution:
Make the effective range determined by the loaded buffers.

Fix #28624
  • Loading branch information
ofseed committed May 7, 2024
1 parent d8deb91 commit c3c673c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/lua/vim/lsp/inlay_hint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ function M.enable(enable, filter)

if filter.bufnr == nil then
globalstate.enabled = enable
for bufnr, _ in pairs(bufstates) do
for _, bufnr in ipairs(api.nvim_list_bufs()) do
if api.nvim_buf_is_loaded(bufnr) then
if enable == false then
_disable(bufnr)
Expand Down

0 comments on commit c3c673c

Please sign in to comment.