Address review feedback from @keith-hall: wrap the abbreviation
removal instructions in a GitHub callout (> [!TIP]) to visually
separate them from the main setup flow. Also reorder so the
'This way, you can keep on using...' sentence follows directly
after the abbreviation creation, improving readability.
Add documentation showing how to erase the fish abbreviations for
--help and -h, since the dash-prefixed names make removal non-obvious.
The key is using -- before the abbreviation name to prevent fish from
interpreting it as a flag.
Closes#3536
- Data flow is now strictly linear from `RawMatcher` to `Matcher`
- I've also hoisted `RawMatcher` in front of `Matcher` to signal this
- Re-type `RawMatcher.case_sensitive` from `bool` to `Option<bool>`
- This moves all parser logic away from `RawMatcher`, making it a more faithful representation of the data
- Favour default consts in `Matcher::try_from<RawMatcher>` to `Default` impl on `Case`
- Because the default choice of casing is a design decision of the logic, not an intrinsic property of the type
The i686 .deb package declared its architecture as "i686", which
Debian does not recognize. Debian uses "i386" for 32-bit x86,
matching the convention already used by the other targets (arm64,
armhf, amd64).
Closes#3611
When bat is built without the `git` feature, `StyleComponent::Changes`
is not available. Add `#[cfg(feature = "git")]` guard so `--diff --plain`
works in both configurations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Added `Deserialize` derive and `#[serde(try_from = "RawMatcher")]` to the `Matcher` struct. With `try_from`, serde generates a `Deserialize` impl that first deserializes into `RawMatcher`, then calls `TryFrom<RawMatcher> for Matcher`. It never attempts to deserialize `Matcher`'s fields directly, so `Case` and `MatcherSegment` don't need `Deserialize` impls.
2. Replaced the manual `impl<'de> serde::Deserialize<'de> for Matcher` with a standard `impl TryFrom<RawMatcher> for Matcher`. The logic is identical - the conversion is fallible because `Matcher::from_str` returns `Result<_, anyhow::Error>`, so `try_from` (not `from`) is the correct choice, avoiding any panics.
The net effect: same behavior, same error handling, but using the idiomatic serde pattern instead of a manual deserializer impl. The `RawMatcher` intermediate type and its `#[serde(untagged)]` derive remain unchanged.
Control characters displayed in caret notation (e.g. ^@ for NUL)
occupy 2 terminal columns, but the width calculation treated them
as 0-width. Add a char_width() helper that returns 2 for control
characters, fixing incorrect line wrapping with --binary=as-text.
Fixes#3631
When --plain is set (via CLI or config file), --diff output loses all
visual markers, making it indistinguishable from plain text. The diff
line filtering still works, but without Changes markers or Snip
separators the output is not useful.
Automatically include Changes and Snip style components when --diff is
active alongside --plain. This preserves the --plain intent (no grid,
no header, no line numbers) while keeping diff output readable.
Closes#3630
Fix two inconsistencies in MUSL .deb package naming:
1. Change dpkg_arch for aarch64-unknown-linux-musl from `arm64` to
`musl-linux-arm64` to match the convention used by other MUSL targets.
2. Change the DPKG_BASENAME case pattern from `*-musl)` to `*-musl*)`
so it also matches `musleabihf`, giving the arm target the `bat-musl`
prefix like all other MUSL packages.
After this fix, all MUSL .deb packages follow the consistent pattern:
`bat-musl_VERSION_musl-linux-ARCH.deb`
Closes#3482
This would catch any dotfiles that end in "ignore", but not `.ignore`
Set as a lower priority rule (90 vs the usual 50) because it's a blanket
assignation. If there are conflict with other, more specific rules,
those will take precedence.