Skip to content

Commit 890c257

Browse files
MariaSolOsgithub-actions[bot]
authored andcommitted
fix(lsp): check nvim.lsp.enable before doautoall #36518
(cherry picked from commit 653871d)
1 parent ae25f69 commit 890c257

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/lua/vim/lsp.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function lsp.enable(name, enable)
632632

633633
-- Ensure any pre-existing buffers start/stop their LSP clients.
634634
if enable ~= false then
635-
if vim.v.vim_did_enter == 1 then
635+
if vim.v.vim_did_enter == 1 and next(lsp._enabled_configs) then
636636
vim.cmd.doautoall('nvim.lsp.enable FileType')
637637
end
638638
else

0 commit comments

Comments
 (0)