From ee7182aba39c61e557f7507d4971167e2761a4b1 Mon Sep 17 00:00:00 2001 From: Nick Jensen Date: Sun, 22 Sep 2024 12:19:42 +1200 Subject: [PATCH] Use a copy of the server list when restarting (#540) If the original server list is used, it is cleared during the step of removing filetype buffers, so no servers are actually restarted, as the `lspservers` list is empty by the time the `for` loop is reached. --- autoload/lsp/lsp.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index d6e0d54c..3e6461b9 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -547,7 +547,7 @@ enddef # Restart the LSP server for the current buffer def RestartServer() - var lspservers: list> = buf.CurbufGetServers() + var lspservers: list> = buf.CurbufGetServers()->copy() if lspservers->empty() util.WarnMsg($'No Lsp servers found for "{@%}"') return