Merge pull request #1250 from kylo252/fixup

chore: remove now-redundant utility function
This commit is contained in:
kylo252 2021-08-06 13:54:25 +02:00 committed by GitHub
commit c8d1b95712
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 28 deletions

View file

@ -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

View file

@ -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