Skip to content

Commit

Permalink
fix: check type(value)==table before recursion (#1039)
Browse files Browse the repository at this point in the history
Signed-off-by: ayamir <[email protected]>
  • Loading branch information
ayamir authored Oct 25, 2023
1 parent 8670c90 commit 3736215
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/modules/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ local function tbl_recursive_merge(dst, src)
dst[key] = value(dst[key])
elseif type(dst[key]) == "table" and vim.tbl_islist(dst[key]) then
vim.list_extend(dst[key], value)
elseif type(dst[key]) == "table" and not vim.tbl_islist(dst[key]) then
elseif type(dst[key]) == "table" and type(value) == "table" and not vim.tbl_islist(dst[key]) then
tbl_recursive_merge(dst[key], value)
else
dst[key] = value
Expand Down

0 comments on commit 3736215

Please sign in to comment.