aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/inlay_hint.lua
diff options
context:
space:
mode:
authorYi Ming <ofseed@foxmail.com>2024-05-07 17:30:19 +0800
committerGitHub <noreply@github.com>2024-05-07 02:30:19 -0700
commitc3c673cdeca25594454f8721e725e6ff1127e2a8 (patch)
treedf5236ad2f1c63a5383e7416d09dc2e6b643b311 /runtime/lua/vim/lsp/inlay_hint.lua
parentd8deb91819d68160e79c1259e9020171ae7e5593 (diff)
downloadrneovim-c3c673cdeca25594454f8721e725e6ff1127e2a8.tar.gz
rneovim-c3c673cdeca25594454f8721e725e6ff1127e2a8.tar.bz2
rneovim-c3c673cdeca25594454f8721e725e6ff1127e2a8.zip
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 (limited to 'runtime/lua/vim/lsp/inlay_hint.lua')
-rw-r--r--runtime/lua/vim/lsp/inlay_hint.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua
index c6be54e65f..d983357a2c 100644
--- 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)