mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
fix(lsp): check if buffer is valid before LspDetach autocmd (#29162)
This commit is contained in:
@ -393,7 +393,7 @@ local function on_client_exit(code, signal, client_id)
|
||||
|
||||
vim.schedule(function()
|
||||
for bufnr in pairs(client.attached_buffers) do
|
||||
if client and client.attached_buffers[bufnr] then
|
||||
if client and client.attached_buffers[bufnr] and api.nvim_buf_is_valid(bufnr) then
|
||||
api.nvim_exec_autocmds('LspDetach', {
|
||||
buffer = bufnr,
|
||||
modeline = false,
|
||||
|
Reference in New Issue
Block a user