From: Nick Jensen Date: Sun, 22 Sep 2024 00:19:42 +0000 (+1200) Subject: Use a copy of the server list when restarting (#540) X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ee7182aba39c61e557f7507d4971167e2761a4b1;p=vim-lsp.git 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. --- diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index d6e0d54..3e6461b 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