From 43e384dc02935722eb5931faa8418d5458931a1e Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 27 May 2024 21:08:30 +0300 Subject: [PATCH] fix(util.toggle): In accordance with #3202 With this change we can disable inlay hints only in a single buffer without disabling them globally (as the current state is). Some things to consider: - Do we want to consider both `bufstate` and `globalstate`? In this case, maybe we should not merge this and just add 2 keymaps, one where we pass `buffer` (`bufstate`) and one where we don't pass anything (`globalstate`)? But in `nvim-lspconfig` spec we pass `buffer` to toggle them on (`bufstate`), but I guess that only has effect on the `is_enabled` when checking for the value. - Or just don't merge this and keep enabling/disabling globally only. --- lua/lazyvim/util/toggle.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 543d4c13..cfb87475 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -69,7 +69,7 @@ function M.inlay_hints(buf, value) if value == nil then value = not ih.is_enabled({ bufnr = buf or 0 }) end - ih.enable(value, { bufnr = buf }) + ih.enable(value, { bufnr = buf or 0 }) end end