From 3736215caa979ed3755bd4f1efa4bf9b6290945c Mon Sep 17 00:00:00 2001 From: Mohu Date: Wed, 25 Oct 2023 21:03:44 +0800 Subject: [PATCH] fix: check `type(value)==table` before recursion (#1039) Signed-off-by: ayamir --- lua/modules/utils/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/utils/init.lua b/lua/modules/utils/init.lua index bc402b7ed..c1bfe0ace 100644 --- a/lua/modules/utils/init.lua +++ b/lua/modules/utils/init.lua @@ -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