From d66c000d48a403b5e1d0010fa1d214e4ff7e3842 Mon Sep 17 00:00:00 2001 From: DragonBillow <42114817+cathaysia@users.noreply.github.com> Date: Wed, 15 Jun 2022 17:18:38 +0800 Subject: [PATCH] fix: show all lsp of mulit-lsps workspace --- lua/ui/statusline.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/ui/statusline.lua b/lua/ui/statusline.lua index 43dae4e..b0f2d9c 100644 --- a/lua/ui/statusline.lua +++ b/lua/ui/statusline.lua @@ -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