From ee6ca2ecc09b323f15fccfbb3e44f5acbe117fe8 Mon Sep 17 00:00:00 2001 From: Jonas Bloch <128738169+Silzinc@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:49:21 +0200 Subject: [PATCH] fix(lazygit): allow passing dictionary as yaml array item Certain configuration options expect an array of dictionaries, e.g. to use a different git pager. --- lua/snacks/lazygit.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/snacks/lazygit.lua b/lua/snacks/lazygit.lua index 210f73dff..12ddbaebb 100644 --- a/lua/snacks/lazygit.lua +++ b/lua/snacks/lazygit.lua @@ -173,7 +173,13 @@ local function update_config(opts) if type(v) == "table" then if (vim.islist or vim.tbl_islist)(v) then for _, item in ipairs(v) do - table.insert(lines, string.rep(" ", indent + 2) .. "- " .. yaml_val(item)) + if type(item) == "table" and not (vim.islist or vim.tbl_islist)(item) then + local item_lines = to_yaml(item, indent + 4) + item_lines[1] = string.rep(" ", indent + 2) .. "- " .. string.sub(item_lines[1], indent + 5) + vim.list_extend(lines, item_lines) + else + table.insert(lines, string.rep(" ", indent + 2) .. "- " .. yaml_val(item)) + end end else vim.list_extend(lines, to_yaml(v, indent + 2))