Skip to content

Conversation

ddzero2c
Copy link

Summary

Fixes a bug where the legacy diff options vertical_split and open_in_current_tab were not working correctly.

Problem

The backward compatibility mapping was checking if fields were nil after merging with defaults, but those fields were already populated by the merge, so the legacy options were never applied.

Example of broken behavior:

require("claudecode").setup({
  diff_opts = {
    vertical_split = false,  -- This was ignored! Always got vertical split
  }
})

Solution

Changed the logic to unconditionally apply legacy option mappings when the legacy options are present. This ensures backward compatibility without complex conditional checks.

Changes:

  • vertical_split=false now correctly sets layout="horizontal"
  • vertical_split=true now correctly sets layout="vertical"
  • open_in_current_tab=false now correctly sets open_in_new_tab=true
  • open_in_current_tab=true now correctly sets open_in_new_tab=false

Testing

Manually tested all scenarios:

  • ✅ Legacy options work correctly
  • ✅ New options continue to work
  • ✅ Default behavior unchanged
  • make format passes (no changes needed)

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant