Skip to content

Commit 6af7df0

Browse files
ddzero2cclaude
andauthored
fix: legacy diff options not working due to merge order (#142)
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 <noreply@anthropic.com>
1 parent ac2baef commit 6af7df0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/claudecode/config.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ function M.apply(user_config)
205205
-- Backward compatibility: map legacy diff options to new fields if provided
206206
if config.diff_opts then
207207
local d = config.diff_opts
208-
-- Map vertical_split -> layout (only if layout not explicitly set)
209-
if d.layout == nil and type(d.vertical_split) == "boolean" then
208+
-- Map vertical_split -> layout (legacy option takes precedence)
209+
if type(d.vertical_split) == "boolean" then
210210
d.layout = d.vertical_split and "vertical" or "horizontal"
211211
end
212-
-- Map open_in_current_tab -> open_in_new_tab (invert; only if not explicitly set)
213-
if d.open_in_new_tab == nil and type(d.open_in_current_tab) == "boolean" then
212+
-- Map open_in_current_tab -> open_in_new_tab (legacy option takes precedence)
213+
if type(d.open_in_current_tab) == "boolean" then
214214
d.open_in_new_tab = not d.open_in_current_tab
215215
end
216216
end

0 commit comments

Comments
 (0)