Skip to content

Fix syntax theme previews to use normal option initialization - #2230

Open
pederbe wants to merge 1 commit into
dandavison:mainfrom
pederbe:learn/2175-syntax-theme-preview
Open

Fix syntax theme previews to use normal option initialization#2230
pederbe wants to merge 1 commit into
dandavison:mainfrom
pederbe:learn/2175-syntax-theme-preview

Conversation

@pederbe

@pederbe pederbe commented Sep 6, 2026

Copy link
Copy Markdown

Summary

--show-syntax-themes parsed command-line options directly, bypassing Git configuration, environment settings, and computed rendering options. Initialize preview options through the normal path so backgrounds, line filling, and empty-line markers match ordinary rendering with the selected syntax theme.

Add ANSI-output comparisons for dark and light themes, true-color modes, and a Git-config feature with environment-based color detection.

Fixes #2175.

Testing

  • Both new regression tests pass. The output comparison failed with the old initialization.
  • cargo test --locked: 416 passed, 1 failed, 8 ignored. The Windows path-separator failure in subcommands::external::test::subcommand_rg also reproduces on unchanged upstream HEAD.
  • cargo clippy --locked --all-targets and cargo fmt -- --check pass. Clippy reports warnings outside the changed code.
  • cargo build --locked --release passes. Command-line checks confirm matching ANSI output for dark/light themes, both theme groups without an explicit mode, and a custom config; the built-in sample also renders successfully.
  • C dependencies were built with CFLAGS=-g0 to avoid a MinGW 8.1 debug-information compiler crash.
  • Ubuntu 26.04 under WSL 2: 440 unit tests passed, 8 ignored. The deprecated-option and pager-history integration scripts pass, as do Clippy, formatting, and the release CLI checks.
  • Linux make test stops at the raw-output/history comparison because binary-file notices are omitted. The same failure reproduces with unchanged upstream source. The other two shell scripts were run separately.

@pederbe
pederbe marked this pull request as ready for review September 6, 2026 06:52
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.

--show-syntax-themes preview does not match actual rendering

1 participant