Преглед изворни кода

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 `..`
Rafael Madriz пре 2 година
родитељ
комит
6f8b96de9d
1 измењених фајлова са 2 додато и 3 уклоњено
  1. 2 3
      lua/lvim/core/lualine/components.lua

+ 2 - 3
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 .. "%*"