From 559a7e8c6c980106f5d53a7763dad509aa5dbfc1 Mon Sep 17 00:00:00 2001 From: glepnir Date: Mon, 29 Apr 2024 14:44:42 +0800 Subject: fix(command): get attached buffers list by using api (#3130) Problem: buffers id as key in attached_buffers. Solution: use api to get buffers list for later restart and attach --- plugin/lspconfig.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua index d730d2b8..03fdc2f4 100644 --- a/plugin/lspconfig.lua +++ b/plugin/lspconfig.lua @@ -91,7 +91,7 @@ api.nvim_create_user_command('LspRestart', function(info) for _, client in ipairs(get_clients_from_cmd_args(info.args)) do client.stop() if vim.tbl_count(client.attached_buffers) > 0 then - detach_clients[client.name] = { client, client.attached_buffers } + detach_clients[client.name] = { client, lsp.get_buffers_by_client_id(client.id) } end end local timer = vim.loop.new_timer() -- cgit v1.2.3-70-g09d2