From d191bdf9d5e54722e28ddb0cccc8eb2312a234df Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Fri, 30 Jun 2023 17:12:58 +0530 Subject: fix(lsp): fix attempt to call non existent function (#24212) Commit 37079fc moved inlay_hint to vim.lsp() but in the process did missed converting a call to disable/enable which are now local. Fixes the below error when trying to toggle inlay hints. E5108: Error executing lua /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:248: attempt to call field 'disable' (a nil value) stack traceback: /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:248: in function 'toggle' /usr/local/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:310: in function 'inlay_hint' [string ":lua"]:1: in main chunk --- runtime/lua/vim/lsp/inlay_hint.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua index 1af18bbc61..f577a31696 100644 --- a/runtime/lua/vim/lsp/inlay_hint.lua +++ b/runtime/lua/vim/lsp/inlay_hint.lua @@ -245,9 +245,9 @@ local function toggle(bufnr) bufnr = resolve_bufnr(bufnr) local bufstate = bufstates[bufnr] if bufstate and bufstate.enabled then - M.disable(bufnr) + disable(bufnr) else - M.enable(bufnr) + enable(bufnr) end end -- cgit