Skip to content

Commit 1b4cd27

Browse files
committed
fix(status): filter duplicate client names
1 parent a79b6fc commit 1b4cd27

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/astroui/status/provider.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,14 @@ function M.lsp_client_names(opts)
547547
if opts.integrations["nvim-lint"] and package.loaded["lint"] then -- nvim-lint integration
548548
vim.list_extend(buf_client_names, require("lint")._resolve_linter_by_ft(vim.bo[bufnr].filetype))
549549
end
550-
local str = table.concat(buf_client_names, ", ")
550+
local buf_client_names_set, client_name_lookup = {}, {}
551+
for _, client in ipairs(buf_client_names) do
552+
if not client_name_lookup[client] then
553+
client_name_lookup[client] = true
554+
table.insert(buf_client_names_set, client)
555+
end
556+
end
557+
local str = table.concat(buf_client_names_set, ", ")
551558
if type(opts.truncate) == "number" then
552559
local max_width = math.floor(status_utils.width() * opts.truncate)
553560
if #str > max_width then str = str:sub(0, max_width) .. "" end

0 commit comments

Comments
 (0)