1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-21 16:43:19 +00:00
Files
sharkdp--bat/tests
Adrian Rivera c75cc01eef Fix --ignored-suffix to fall back to first-line detection
When an ignored suffix is also a registered extension (e.g. `.txt` maps to
"Plain Text"), `get_syntax_for_file_extension` matched the raw extension
before attempting the suffix strip. As a result `--ignored-suffix .txt` had
no effect on such files and first-line/shebang detection was never reached,
so a shell script saved as `*.txt` stayed unhighlighted.

Strip ignored suffixes first and detect on the remainder; only fall back to
the raw extension when no ignored suffix applies. When a suffix is stripped
but the remainder has no syntax, return `None` so the caller can use
first-line detection. Default behavior (no `--ignored-suffix`) is unchanged.

See #2745.
2026-06-30 12:20:14 -07:00
..
2025-08-28 17:30:50 +00:00
2022-06-12 16:38:33 +02:00
2026-06-26 20:27:49 +02:00
2021-06-14 08:36:20 +02:00
2026-01-14 21:13:44 -07:00
2024-01-27 14:44:54 +00:00