Ver Fonte

Merge pull request #1250 from kylo252/fixup

chore: remove now-redundant utility function
kylo252 há 3 anos atrás
pai
commit
c8d1b95712
2 ficheiros alterados com 1 adições e 28 exclusões
  1. 1 2
      lua/core/galaxyline.lua
  2. 0 26
      lua/utils/init.lua

+ 1 - 2
lua/core/galaxyline.lua

@@ -203,7 +203,6 @@ table.insert(gls.right, {
 local function get_attached_provider_name(msg)
   msg = msg or "LSP Inactive"
   local buf_clients = vim.lsp.buf_get_clients()
-  local utils = require "utils"
   if next(buf_clients) == nil then
     return msg
   end
@@ -215,7 +214,7 @@ local function get_attached_provider_name(msg)
       table.insert(buf_client_names, client.name)
     end
   end
-  utils.list_extend_unique(buf_client_names, null_ls_providers)
+  vim.list_extend(buf_client_names, null_ls_providers)
   return table.concat(buf_client_names, ", ")
 end
 

+ 0 - 26
lua/utils/init.lua

@@ -113,32 +113,6 @@ function utils.get_active_client_by_ft(filetype)
   return nil
 end
 
---- Extends a list-like table with the unique values of another list-like table.
----
---- NOTE: This mutates dst!
----
---@see |vim.tbl_extend()|
----
---@param dst list which will be modified and appended to.
---@param src list from which values will be inserted.
---@param start Start index on src. defaults to 1
---@param finish Final index on src. defaults to #src
---@returns dst
-function utils.list_extend_unique(dst, src, start, finish)
-  vim.validate {
-    dst = { dst, "t" },
-    src = { src, "t" },
-    start = { start, "n", true },
-    finish = { finish, "n", true },
-  }
-  for i = start or 1, finish or #src do
-    if not vim.tbl_contains(dst, src[i]) then
-      table.insert(dst, src[i])
-    end
-  end
-  return dst
-end
-
 function utils.unrequire(m)
   package.loaded[m] = nil
   _G[m] = nil