fix: show all lsp of mulit-lsps workspace

This commit is contained in:
DragonBillow 2022-06-15 17:18:38 +08:00 committed by siduck
parent aabf8ca225
commit d66c000d48
1 changed files with 8 additions and 3 deletions

View File

@ -149,13 +149,18 @@ end
M.LSP_status = function()
local clients = vim.lsp.get_active_clients()
local name = false
local names = {}
for _, client in ipairs(clients) do
if client.attached_buffers[vim.api.nvim_get_current_buf()] then
name = client.name
break
table.insert(names, client.name)
end
end
local name = false
if names ~= {} then
name = table.concat(names, '/')
end
local content = name and "  LSP ~ " .. name .. " " or false
return content and ("%#St_LspStatus#" .. content) or ""
end