Skip to content

Commit

Permalink
Use a copy of the server list when restarting (#540)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nickspoons authored Sep 22, 2024
1 parent 0777322 commit ee7182a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/lsp/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ enddef

# Restart the LSP server for the current buffer
def RestartServer()
var lspservers: list<dict<any>> = buf.CurbufGetServers()
var lspservers: list<dict<any>> = buf.CurbufGetServers()->copy()
if lspservers->empty()
util.WarnMsg($'No Lsp servers found for "{@%}"')
return
Expand Down

0 comments on commit ee7182a

Please sign in to comment.