diff options
Diffstat (limited to '')
-rw-r--r-- | lua/core/statusbar/components.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lua/core/statusbar/components.lua b/lua/core/statusbar/components.lua index cce3127..f731688 100644 --- a/lua/core/statusbar/components.lua +++ b/lua/core/statusbar/components.lua @@ -239,15 +239,11 @@ end function M.lsp_srvname(opts) local fmt = opts.fmt or "%s" local icon = opts.icon or "" - local buf_clients = vim.lsp.buf_get_clients(0) - if not buf_clients or #buf_clients == 0 then - return "" - end local names = "" - for i, c in ipairs(buf_clients) do - if i > 1 then names = names .. ", " end - names = names .. c.name - end + vim.lsp.for_each_buffer_client(0, function(client) + if names ~= "" then names = names..", " end + names = names..client.name + end) return icon..fmt:format(names) end |