From 6f8b96de9d2e7c355b7ba3cf1d5b0cc115f128a7 Mon Sep 17 00:00:00 2001 From: Rafael Madriz Date: Thu, 25 May 2023 03:12:55 -0300 Subject: [PATCH] refactor(lualine): use `string.format` to return unique names (#4193) To purpose of this change is to make code more redeable by making `unique_client_names` a string with the unique names instead of a table and later on calling `table.concat`. Then use `string.format` instead of string concatenation with `..` --- lua/lvim/core/lualine/components.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/lvim/core/lualine/components.lua b/lua/lvim/core/lualine/components.lua index 7755b933..a6593619 100644 --- a/lua/lvim/core/lualine/components.lua +++ b/lua/lvim/core/lualine/components.lua @@ -123,9 +123,8 @@ return { local supported_linters = linters.list_registered(buf_ft) vim.list_extend(buf_client_names, supported_linters) - local unique_client_names = vim.fn.uniq(buf_client_names) - - local language_servers = "[" .. table.concat(unique_client_names, ", ") .. "]" + local unique_client_names = table.concat(buf_client_names, ", ") + local language_servers = string.format("[%s]", unique_client_names) if copilot_active then language_servers = language_servers .. "%#SLCopilot#" .. " " .. lvim.icons.git.Octoface .. "%*"