mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 01:08:59 +02:00
fix(lsp): better way of extending deeply nested lists. Fixes #3398
This commit is contained in:
parent
7782affc90
commit
9f2cc30246
3 changed files with 19 additions and 20 deletions
|
@ -72,6 +72,19 @@ function M.on_very_lazy(fn)
|
|||
})
|
||||
end
|
||||
|
||||
function M.extend(t, key, value)
|
||||
local keys = vim.split(key, ".", { plain = true })
|
||||
for i = 1, #keys do
|
||||
local k = keys[i]
|
||||
t[k] = t[k] or {}
|
||||
if type(t) ~= "table" then
|
||||
return
|
||||
end
|
||||
t = t[k]
|
||||
end
|
||||
t[#t + 1] = value
|
||||
end
|
||||
|
||||
---@param name string
|
||||
function M.opts(name)
|
||||
local plugin = require("lazy.core.config").spec.plugins[name]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue