From f8d88ad69e7b3d3701c87701ff115876a2f76833 Mon Sep 17 00:00:00 2001 From: Ryder Date: Sat, 11 Oct 2025 21:34:15 +0800 Subject: [PATCH] fix: legacy diff options not working due to merge order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backward compatibility mapping for `vertical_split` and `open_in_current_tab` options was not working because it checked if the merged config had nil values, but after merging with defaults, these fields were already populated. Fixed by unconditionally applying the legacy option mappings when the legacy options are present. This ensures backward compatibility for users still using the old option names. Fixes: - vertical_split=false now correctly sets layout="horizontal" - open_in_current_tab=false now correctly sets open_in_new_tab=true 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- lua/claudecode/config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/claudecode/config.lua b/lua/claudecode/config.lua index e674160..a46fd2b 100644 --- a/lua/claudecode/config.lua +++ b/lua/claudecode/config.lua @@ -205,12 +205,12 @@ function M.apply(user_config) -- Backward compatibility: map legacy diff options to new fields if provided if config.diff_opts then local d = config.diff_opts - -- Map vertical_split -> layout (only if layout not explicitly set) - if d.layout == nil and type(d.vertical_split) == "boolean" then + -- Map vertical_split -> layout (legacy option takes precedence) + if type(d.vertical_split) == "boolean" then d.layout = d.vertical_split and "vertical" or "horizontal" end - -- Map open_in_current_tab -> open_in_new_tab (invert; only if not explicitly set) - if d.open_in_new_tab == nil and type(d.open_in_current_tab) == "boolean" then + -- Map open_in_current_tab -> open_in_new_tab (legacy option takes precedence) + if type(d.open_in_current_tab) == "boolean" then d.open_in_new_tab = not d.open_in_current_tab end end