From 890c2571944796e832bed95c2c7fa72715976fc6 Mon Sep 17 00:00:00 2001 From: Maria Solano Date: Tue, 11 Nov 2025 21:04:31 -0800 Subject: [PATCH] fix(lsp): check `nvim.lsp.enable` before `doautoall` #36518 (cherry picked from commit 653871da1b5507d3391239854982438872ad4032) --- runtime/lua/vim/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index cec325f6b0..3dc5f2ba5e 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -632,7 +632,7 @@ function lsp.enable(name, enable) -- Ensure any pre-existing buffers start/stop their LSP clients. if enable ~= false then - if vim.v.vim_did_enter == 1 then + if vim.v.vim_did_enter == 1 and next(lsp._enabled_configs) then vim.cmd.doautoall('nvim.lsp.enable FileType') end else