get lsp server name more consistently for the statusbar
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user