mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
add: global variable unique_list
This commit is contained in:
parent
024214153a
commit
fc32c1b69c
1 changed files with 14 additions and 0 deletions
|
@ -37,6 +37,20 @@ _G.idxOf = function(array, value)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
_G.unique_list = function(list)
|
||||||
|
local seen = {}
|
||||||
|
local result = {}
|
||||||
|
|
||||||
|
for _, val in ipairs(list) do
|
||||||
|
if not seen[val] then
|
||||||
|
table.insert(result, val)
|
||||||
|
seen[val] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
-- run if rust config true
|
-- run if rust config true
|
||||||
if pcode.active_rust_config then
|
if pcode.active_rust_config then
|
||||||
table.insert(pcode.mason_ensure_installed, "rust_analyzer")
|
table.insert(pcode.mason_ensure_installed, "rust_analyzer")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue