From 141abc1f94a8ab88097f253e7c41d95708b7431c Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Fri, 3 May 2024 11:44:05 +0530 Subject: [PATCH] nvim: lsp: Inlay hints API has changed With the recent change to the API, without passing buffer number as 0 for the current buffer, inlay hints gets enabled for all buffers. --- nvim/.config/nvim/lua/lsp.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 46cc750..25ea969 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -16,7 +16,10 @@ local peek_definition = function() end local inlay_hint_toggle = function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + local filter = { bufnr = 0 } + local enabled = vim.lsp.inlay_hint.is_enabled(filter) + + vim.lsp.inlay_hint.enable(not enabled, filter) end _G.InlayHintToggle = inlay_hint_toggle