fix(lsp): check nvim.lsp.enable before doautoall #36518

This commit is contained in:
Maria Solano
2025-11-11 21:04:31 -08:00
committed by GitHub
parent 1bc85d29c1
commit 653871da1b

View File

@@ -581,7 +581,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