fix: bedrock (#1524)

* fix: bedrock

* fix: bad variable name

* fix: missing metatable
This commit is contained in:
yetone
2025-03-08 02:17:28 +08:00
committed by GitHub
parent 4d983532a1
commit d75094b815
8 changed files with 46 additions and 34 deletions

View File

@@ -1015,4 +1015,17 @@ function M.icon(string_with_icon, utf8_fallback)
end
end
function M.deep_extend_with_metatable(behavior, ...)
local tables = { ... }
local base = tables[1]
if behavior == "keep" then base = tables[#tables] end
local mt = getmetatable(base)
local result = vim.tbl_deep_extend(behavior, ...)
if mt then setmetatable(result, mt) end
return result
end
return M