aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2023-06-12 21:15:11 +0800
committerGitHub <noreply@github.com>2023-06-12 21:15:11 +0800
commit4bb563d835081dc991503fc55f0e82a9007845a5 (patch)
treeda69e30dcf732722749d4a7978345edd5fc73c57 /plugin
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.tar
nvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.tar.gz
nvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.tar.bz2
nvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.tar.lz
nvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.tar.xz
nvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.tar.zst
nvim-lspconfig-4bb563d835081dc991503fc55f0e82a9007845a5.zip
fix: lsprestart only restart client which have attached buffer (#2669)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lspconfig.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua
index 09d80c69..5afd0895 100644
--- a/plugin/lspconfig.lua
+++ b/plugin/lspconfig.lua
@@ -90,7 +90,9 @@ api.nvim_create_user_command('LspRestart', function(info)
local detach_clients = {}
for _, client in ipairs(get_clients_from_cmd_args(info.args)) do
client.stop()
- detach_clients[client.name] = client
+ if #client.attached_buffers > 0 then
+ detach_clients[client.name] = client
+ end
end
local timer = vim.loop.new_timer()
timer:start(