1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:30:05 +08:00

fix(lsp): set server_ready to false on LspDetach

This commit is contained in:
Eric Wong 2024-05-21 12:10:31 +08:00
parent 592bf3941a
commit 4d3c680a93

View File

@ -23,6 +23,12 @@ function M.setup(enabled_clients, override_client_cmds) -- {{{
vim.api.nvim_buf_set_var(args.buf, 'lsp_server_ready', true) vim.api.nvim_buf_set_var(args.buf, 'lsp_server_ready', true)
end, end,
}) })
vim.api.nvim_create_autocmd('LspDetach', {
group = augroup,
callback = function(args)
vim.api.nvim_buf_set_var(args.buf, 'lsp_server_ready', false)
end,
})
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer