소스 검색

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