neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit c3c673cdeca25594454f8721e725e6ff1127e2a8
parent d8deb91819d68160e79c1259e9020171ae7e5593
Author: Yi Ming <ofseed@foxmail.com>
Date:   Tue,  7 May 2024 17:30:19 +0800

fix(lsp): enable() does not activate inlay hints on open buffers #28629

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
Diffstat:
Mruntime/lua/vim/lsp/inlay_hint.lua | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua @@ -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)