on ea5aaa0 help sign in
12 files changed+11−113
since splitsnapshots
unifiedsplit
.github/ISSUE_TEMPLATE/question.md−2 .github/workflows/CICD.yml+1−1 CHANGELOG.md+2−20 Cargo.lock+1−1 Cargo.toml+1−1 assets/syntaxes.bin assets/syntaxes/02_Extra/INI.sublime-syntax+2−2 doc/release-checklist.md+4−5 src/assets.rs−57 tests/integration_tests.rs−14 tests/syntax-tests/highlighted/INI/test.inf−5 tests/syntax-tests/source/INI/test.inf−5
.github/ISSUE_TEMPLATE/question.md−2
@@ -7,5 +7,3 @@ assignees: ''
77
88---
99
10−<!-- Using a normal ticket is still fine, but feel free to ask your
11−questions about bat on https://github.com/sharkdp/bat/discussions instead. -->
.github/workflows/CICD.yml+1−1
@@ -154,7 +154,7 @@ jobs:
154154 - { target: x86_64-apple-darwin , os: macos-10.15 }
155155 - { target: x86_64-pc-windows-gnu , os: windows-2019 }
156156 - { target: x86_64-pc-windows-msvc , os: windows-2019 }
157− - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
157+ - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
158158 - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
159159 steps:
160160 - name: Checkout source code
CHANGELOG.md+2−20
@@ -2,25 +2,6 @@
22
33## Features
44
5−- Make the default macOS theme depend on Dark Mode. See #2197, #1746 (@Enselic)
6−
7−## Bugfixes
8−
9−## Other
10−
11−- Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp)
12−
13−## Syntaxes
14−
15−## Themes
16−
17−## `bat` as a library
18−
19−
20−# v0.21.0
21−
22−## Features
23−
245- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9)
256- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath)
267- Enable BusyBox `less` as pager, see #2162 (@nfisher1226)
@@ -47,7 +28,8 @@
4728- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
4829- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
4930- Slightly adjust Zig syntax. See #2136 (@Enselic)
50−- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
31+
32+## Themes
5133
5234## `bat` as a library
5335
Cargo.lock+1−1
@@ -74,7 +74,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
7474
7575[[package]]
7676name = "bat"
77−version = "0.21.0"
77+version = "0.20.0"
7878dependencies = [
7979 "ansi_colours",
8080 "ansi_term",
Cargo.toml+1−1
@@ -6,7 +6,7 @@ homepage = "https://github.com/sharkdp/bat"
66license = "MIT/Apache-2.0"
77name = "bat"
88repository = "https://github.com/sharkdp/bat"
9−version = "0.21.0"
9+version = "0.20.0"
1010exclude = ["assets/syntaxes/*", "assets/themes/*"]
1111build = "build.rs"
1212edition = '2018'
assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/02_Extra/INI.sublime-syntax+2−2
@@ -5,8 +5,8 @@ name: INI
55file_extensions:
66 - ini
77 - INI
8− - "inf"
9− - "INF"
8+ - inf
9+ - INF
1010 - reg
1111 - REG
1212 - lng
doc/release-checklist.md+4−5
@@ -7,13 +7,13 @@
77- [ ] Find the current min. supported Rust version by running
88 `grep '^\s*MIN_SUPPORTED_RUST_VERSION' .github/workflows/CICD.yml`.
99- [ ] Update the version and the min. supported Rust version in `README.md` and
10− `doc/README-*.md`. Check with
11− `git grep -i -e 'rust.*1\.' -e '1\..*rust' | grep README | grep -v tests/`.
10+ `doc/README-*.md`. Check with `git grep -i 'rust.*1\.'` and
11+ `git grep -i '1\..*rust'`.
1212- [ ] Update `CHANGELOG.md`. Introduce a section for the new release.
1313
1414## Update syntaxes and themes (build assets)
1515
16−- [ ] Install the latest master version (`cargo clean && cargo install --locked -f --path .`) and make
16+- [ ] Install the latest master version (`cargo clean && cargo install -f --path .`) and make
1717 sure that it is available on the `PATH` (`bat --version` should show the
1818 new version).
1919- [ ] Run `assets/create.sh` and check in the binary asset files.
@@ -22,7 +22,6 @@
2222
2323- [ ] Review `-h`, `--help`, and the `man` page. All of these are shown in
2424 the output of the CI job called *Documentation*, so look there.
25− The CI workflow corresponding to the tip of the master branch is a good place to look.
2625
2726## Pre-release checks
2827
@@ -31,7 +30,7 @@
3130- [ ] Optional: manually test the new features and command-line options. To do
3231 this, install the latest `bat` version again (to include the new syntaxes
3332 and themes).
34−- [ ] Run `cargo publish --dry-run` to make sure that it will
33+- [ ] Run `cargo publish --dry-run --allow-dirty` to make sure that it will
3534 succeed later (after creating the GitHub release).
3635
3736## Release
src/assets.rs−57
@@ -69,57 +69,10 @@ impl HighlightingAssets {
6969 }
7070 }
7171
72− /// The default theme.
73− ///
74− /// ### Windows and Linux
75− ///
76− /// Windows and most Linux distributions has a dark terminal theme by
77− /// default. On these platforms, this function always returns a theme that
78− /// looks good on a dark background.
79− ///
80− /// ### macOS
81− ///
82− /// On macOS the default terminal background is light, but it is common that
83− /// Dark Mode is active, which makes the terminal background dark. On this
84− /// platform, the default theme depends on
85− /// ```bash
86− /// defaults read -globalDomain AppleInterfaceStyle
87− /// ````
88− /// To avoid the overhead of the check on macOS, simply specify a theme
89− /// explicitly via `--theme`, `BAT_THEME`, or `~/.config/bat`.
90− ///
91− /// See <https://github.com/sharkdp/bat/issues/1746> and
92− /// <https://github.com/sharkdp/bat/issues/1928> for more context.
9372 pub fn default_theme() -> &'static str {
94− #[cfg(not(target_os = "macos"))]
95− {
96− Self::default_dark_theme()
97− }
98− #[cfg(target_os = "macos")]
99− {
100− if macos_dark_mode_active() {
101− Self::default_dark_theme()
102− } else {
103− Self::default_light_theme()
104− }
105− }
106− }
107−
108− /**
109− * The default theme that looks good on a dark background.
110− */
111− fn default_dark_theme() -> &'static str {
11273 "Monokai Extended"
11374 }
11475
115− /**
116− * The default theme that looks good on a light background.
117− */
118− #[cfg(target_os = "macos")]
119− fn default_light_theme() -> &'static str {
120− "Monokai Extended Light"
121− }
122−
12376 pub fn from_cache(cache_path: &Path) -> Result<Self> {
12477 Ok(HighlightingAssets::new(
12578 SerializedSyntaxSet::FromFile(cache_path.join("syntaxes.bin")),
@@ -399,16 +352,6 @@ fn asset_from_cache<T: serde::de::DeserializeOwned>(
399352 .map_err(|_| format!("Could not parse cached {}", description).into())
400353}
401354
402−#[cfg(target_os = "macos")]
403−fn macos_dark_mode_active() -> bool {
404− let mut defaults_cmd = std::process::Command::new("defaults");
405− defaults_cmd.args(&["read", "-globalDomain", "AppleInterfaceStyle"]);
406− match defaults_cmd.output() {
407− Ok(output) => output.stdout == b"Dark\n",
408− Err(_) => true,
409− }
410−}
411−
412355#[cfg(test)]
413356mod tests {
414357 use super::*;
tests/integration_tests.rs−14
@@ -1427,8 +1427,6 @@ fn ansi_passthrough_emit() {
14271427fn ignored_suffix_arg() {
14281428 bat()
14291429 .arg("-f")
1430− .arg("--theme")
1431− .arg("Monokai Extended")
14321430 .arg("-p")
14331431 .arg("test.json~")
14341432 .assert()
@@ -1438,8 +1436,6 @@ fn ignored_suffix_arg() {
14381436
14391437 bat()
14401438 .arg("-f")
1441− .arg("--theme")
1442− .arg("Monokai Extended")
14431439 .arg("-p")
14441440 .arg("--ignored-suffix=.suffix")
14451441 .arg("test.json.suffix")
@@ -1450,8 +1446,6 @@ fn ignored_suffix_arg() {
14501446
14511447 bat()
14521448 .arg("-f")
1453− .arg("--theme")
1454− .arg("Monokai Extended")
14551449 .arg("-p")
14561450 .arg("test.json.suffix")
14571451 .assert()
@@ -1469,8 +1463,6 @@ fn highlighting_is_skipped_on_long_lines() {
14691463
14701464 bat()
14711465 .arg("-f")
1472− .arg("--theme")
1473− .arg("Monokai Extended")
14741466 .arg("-p")
14751467 .arg("longline.json")
14761468 .assert()
@@ -1490,8 +1482,6 @@ fn all_global_git_config_locations_syntax_mapping_work() {
14901482 bat()
14911483 .env("XDG_CONFIG_HOME", fake_home.join(".config").as_os_str())
14921484 .arg("-f")
1493− .arg("--theme")
1494− .arg("Monokai Extended")
14951485 .arg("-p")
14961486 .arg("git/.config/git/config")
14971487 .assert()
@@ -1502,8 +1492,6 @@ fn all_global_git_config_locations_syntax_mapping_work() {
15021492 bat()
15031493 .env("HOME", fake_home.as_os_str())
15041494 .arg("-f")
1505− .arg("--theme")
1506− .arg("Monokai Extended")
15071495 .arg("-p")
15081496 .arg("git/.config/git/config")
15091497 .assert()
@@ -1514,8 +1502,6 @@ fn all_global_git_config_locations_syntax_mapping_work() {
15141502 bat()
15151503 .env("HOME", fake_home.as_os_str())
15161504 .arg("-f")
1517− .arg("--theme")
1518− .arg("Monokai Extended")
15191505 .arg("-p")
15201506 .arg("git/.gitconfig")
15211507 .assert()
tests/syntax-tests/highlighted/INI/test.infdeleted−5
@@ -1,5 +0,0 @@
1−[section]
2−key=value
3−# This file is just for testing that the INI syntax is registered to handle
4−# the .inf file extension, it is not testing the syntax highlighting capabilities
5−# of the INI syntax itself
tests/syntax-tests/source/INI/test.infdeleted−5
@@ -1,5 +0,0 @@
1−[section]
2−key=value
3−# This file is just for testing that the INI syntax is registered to handle
4−# the .inf file extension, it is not testing the syntax highlighting capabilities
5−# of the INI syntax itself