Skip to content

Fix #2037: show-config displays incomplete hunk-header-style#2114

Open
cobyfrombrooklyn-bot wants to merge 1 commit into
dandavison:mainfrom
cobyfrombrooklyn-bot:fix-issue-2037
Open

Fix #2037: show-config displays incomplete hunk-header-style#2114
cobyfrombrooklyn-bot wants to merge 1 commit into
dandavison:mainfrom
cobyfrombrooklyn-bot:fix-issue-2037

Conversation

@cobyfrombrooklyn-bot
Copy link
Copy Markdown

Fixes #2037

Problem

--show-config drops special attributes (file, line-number, omit-code-fragment) from the hunk-header-style value. With the default line-number syntax, it displays just syntax.

Fix

Reconstructs the full hunk-header-style value in show_config() by prepending the special attribute keywords based on the parsed boolean flags before the style string.

Tests

Added two test cases in src/subcommands/show_config.rs:

  • test_show_config_hunk_header_style_includes_special_attributes — verifies default style shows line-number syntax
  • test_show_config_hunk_header_style_with_file — verifies custom file syntax is displayed correctly

Both tests fail without the fix and pass with it. Full test suite (439 tests) passes.

Tested on macOS ARM (Apple Silicon).

Fix dandavison#2037: --show-config now correctly displays special attributes
(file, line-number, omit-code-fragment) in the hunk-header-style value.

Previously, only the parsed Style was shown (e.g. 'syntax'), dropping
the special keywords. With the default 'line-number syntax', show-config
would display just 'syntax'. Now it correctly shows 'line-number syntax'.

Added two test cases that verify the fix for both the default style and
a custom 'file syntax' configuration.
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.

🐛 Some output of --show-config is incorrect

1 participant