aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2024-05-14 19:38:22 +0200
committerGitHub <noreply@github.com>2024-05-14 19:38:22 +0200
commit5eee633c97055fc8c7617f2914835f2860b92d9c (patch)
tree0807ebe539ad4aef17833a2db5e759f4d2185842 /runtime
parent6a264e08974bcb1b91f891eb65ef374f350d2827 (diff)
downloadrneovim-5eee633c97055fc8c7617f2914835f2860b92d9c.tar.gz
rneovim-5eee633c97055fc8c7617f2914835f2860b92d9c.tar.bz2
rneovim-5eee633c97055fc8c7617f2914835f2860b92d9c.zip
fix(lsp): don't start additional client if attach failed (#28744)
If a client for a server was already running and lsp.start was called in an unloaded buffer it started another client instead of bailing out.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/lua/vim/lsp.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 325c30ca38..e2af317823 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -251,6 +251,8 @@ function lsp.start(config, opts)
if reuse_client(client, config) then
if lsp.buf_attach_client(bufnr, client.id) then
return client.id
+ else
+ return nil
end
end
end