on ed7cd1c help sign in
.github/ISSUE_TEMPLATE/bug_report.md+2−19
since splitsnapshots
unifiedsplit
@@ -7,26 +7,9 @@ assignees: ''
7
7
8---
8---
9
9
10−<!--
11−
12−Hey there, thank you for reporting a bug!
10+<!-- Hey there, thank you for creating an issue! -->
13−
14−Please note that the following bugs have already been reported:
15−
16−* dpkg: error processing archive /some/path/some-program.deb (--unpack):
17− trying to overwrite '/usr/.crates2.json'
18−
19− See https://github.com/sharkdp/bat/issues/938
20−
21−-->
22−
23−**What steps will reproduce the bug?**
24−
25−1. step 1
26−2. step 2
27−3. ...
28
11
29−**What happens?**
12+**Describe the bug you encountered:**
30
13
31...
14...
32
15
.github/ISSUE_TEMPLATE/question.md−2
@@ -7,5 +7,3 @@ assignees: ''
7
7
8---
8---
9
9
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−13
@@ -118,18 +118,6 @@ jobs:
118 toolchain: stable
118 toolchain: stable
119 default: true
119 default: true
120 profile: minimal
120 profile: minimal
121− - name: Print -h
122− uses: actions-rs/cargo@v1
123− with:
124− command: run
125− args: --locked -- -h
126− - name: Print --help
127− uses: actions-rs/cargo@v1
128− with:
129− command: run
130− args: --locked -- --help
131− - name: Show man page
132− run: man $(find . -name bat.1)
133 - name: Check documentation
121 - name: Check documentation
134 env:
122 env:
135 RUSTDOCFLAGS: -D warnings
123 RUSTDOCFLAGS: -D warnings
@@ -154,7 +142,7 @@ jobs:
154 - { target: x86_64-apple-darwin , os: macos-10.15 }
142 - { target: x86_64-apple-darwin , os: macos-10.15 }
155 - { target: x86_64-pc-windows-gnu , os: windows-2019 }
143 - { target: x86_64-pc-windows-gnu , os: windows-2019 }
156 - { target: x86_64-pc-windows-msvc , os: windows-2019 }
144 - { target: x86_64-pc-windows-msvc , os: windows-2019 }
157− - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
145+ - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
158 - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
146 - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
159 steps:
147 steps:
160 - name: Checkout source code
148 - name: Checkout source code
.gitmodules−8
@@ -236,11 +236,3 @@
236[submodule "assets/syntaxes/02_Extra/Dart"]
236[submodule "assets/syntaxes/02_Extra/Dart"]
237 path = assets/syntaxes/02_Extra/Dart
237 path = assets/syntaxes/02_Extra/Dart
238 url = https://github.com/elMuso/Dartlight.git
238 url = https://github.com/elMuso/Dartlight.git
239−[submodule "assets/syntaxes/02_Extra/SublimeJQ"]
240− path = assets/syntaxes/02_Extra/SublimeJQ
241− url = https://github.com/zogwarg/SublimeJQ.git
242−[submodule "assets/syntaxes/02_Extra/cmd-help"]
243− path = assets/syntaxes/02_Extra/cmd-help
244− url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
245− branch = main
246− shallow = true
CHANGELOG.md+3−66
@@ -2,72 +2,11 @@
2
2
3## Features
3## Features
4
4
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−
24−- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9)
25−- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath)
26−- Enable BusyBox `less` as pager, see #2162 (@nfisher1226)
27−- File extensions are now matched case-insensitively. See #1854, #2181 (@Enselic)
28−
29−## Bugfixes
30−
31−- Bump `regex` dependency from 1.5.4 to 1.5.5 to fix [CVE-2022-24713](https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html), see #2145, #2139 (@Enselic)
32−- `bat` no longer crashes when encountering files that references missing syntaxes. See #915, #2181 (@Enselic)
33−
34−## Performance
35−
36−- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
37−- Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic)
38−
39−## Other
40−
41−- Include info about custom assets in `--diagnostics` if used. See #2107, #2144 (@Enselic)
42−
43−## Syntaxes
44−
45−- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour)
46−- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
47−- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
48−- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
49−- Slightly adjust Zig syntax. See #2136 (@Enselic)
50−- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
51−
52−## `bat` as a library
53−
54−- Allow configuration of `show_nonprintable` with `PrettyPrinter`, see #2142
55−- The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic)
56−- Mark `bat::error::Error` enum as `#[non_exhaustive]` to allow adding new variants without future semver breakage. See #2181 (@Enselic)
57−- Change `Error::SyntectError(syntect::LoadingError)` to `Error::SyntectError(syntect::Error)`. See #2181 (@Enselic)
58−- Add `Error::SyntectLoadingError(syntect::LoadingError)` enum variant. See #2181 (@Enselic)
59−
60−
61−# v0.20.0
62−
63−## Features
64−
65- New style component `header-filesize` to show size of the displayed file in the header. See #1988 (@mdibaiee)
5- New style component `header-filesize` to show size of the displayed file in the header. See #1988 (@mdibaiee)
66−- Use underline for line highlighting on ANSI, see #1730 (@mdibaiee)
67
6
68## Bugfixes
7## Bugfixes
69
8
70−- Fix bash completion on bash 3.x and bash-completion 1.x. See #2066 (@joshpencheon)
9+## Other
71
10
72## Syntaxes
11## Syntaxes
73
12
@@ -75,14 +14,12 @@
75- Associate `_vimrc` and `_gvimrc` files with the `VimL` syntax. See #2002
14- Associate `_vimrc` and `_gvimrc` files with the `VimL` syntax. See #2002
76- Associate `poetry.lock` files with the `TOML` syntax. See #2049
15- Associate `poetry.lock` files with the `TOML` syntax. See #2049
77- Associate `.mesh`, `.task`, `.rgen`, `.rint`, `.rahit`, `.rchit`, `.rmiss`, and `.rcall` with the `GLSL` syntax. See #2050
16- Associate `.mesh`, `.task`, `.rgen`, `.rint`, `.rahit`, `.rchit`, `.rmiss`, and `.rcall` with the `GLSL` syntax. See #2050
78−- Added support for `JQ` syntax, see #2072
17+
79−- Properly associate global git config files rooted in `$XDG_CONFIG_HOME/git/` or `$HOME/.config/git/`. See #2067 (@cyqsimon)
18+## Themes
80
19
81## `bat` as a library
20## `bat` as a library
82
21
83- Exposed `get_syntax_set` and `get_theme` methods on `HighlightingAssets`. See #2030 (@dandavison)
22- Exposed `get_syntax_set` and `get_theme` methods on `HighlightingAssets`. See #2030 (@dandavison)
84−- Added `HeaderFilename` and `HeaderFilesize` to `StyleComponent` enum, and mark it `#[non_exhaustive]`. See #1988 (@mdibaiee)
85−
86
23
87# v0.19.0
24# v0.19.0
88
25
CONTRIBUTING.md−22
@@ -46,25 +46,3 @@ If you really think that a particular syntax or theme should be added for all
46users, please read the corresponding
46users, please read the corresponding
47[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
47[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
48first.
48first.
49−
50−
51−## Regression tests
52−
53−You are strongly encouraged to add regression tests. Regression tests are great,
54−not least because they:
55−
56−* ensure that your contribution will never completely stop working,
57−
58−* makes code review easier, because it becomes very clear what the code is
59− supposed to do.
60−
61−For functional changes, you most likely want to add a test to
62−[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
63−Look at existing tests to know how to write a new test. In short, you will
64−invoke the `bat` binary with a certain set of arguments, and then assert on
65−stdout/stderr.
66−
67−To learn how to write regression tests for theme and syntax changes, read the
68−[Syntax
69−tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
70−section in `assets.md`.
Cargo.lock+54−75
@@ -74,7 +74,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
74
74
75[[package]]
75[[package]]
76name = "bat"
76name = "bat"
77−version = "0.21.0"
77+version = "0.19.0"
78dependencies = [
78dependencies = [
79 "ansi_colours",
79 "ansi_colours",
80 "ansi_term",
80 "ansi_term",
@@ -155,9 +155,9 @@ dependencies = [
155
155
156[[package]]
156[[package]]
157name = "bugreport"
157name = "bugreport"
158−version = "0.5.0"
158+version = "0.4.1"
159source = "registry+https://github.com/rust-lang/crates.io-index"
159source = "registry+https://github.com/rust-lang/crates.io-index"
160−checksum = "535120b8182547808081a66f1f77a64533c780b23da26763e0ee34dfb94f98c9"
160+checksum = "0014b4b2b4f63bfe69c3838470121290cc437fdc79785d408a761a21e8b2404c"
161dependencies = [
161dependencies = [
162 "git-version",
162 "git-version",
163 "shell-escape",
163 "shell-escape",
@@ -382,9 +382,9 @@ dependencies = [
382
382
383[[package]]
383[[package]]
384name = "flate2"
384name = "flate2"
385−version = "1.0.23"
385+version = "1.0.22"
386source = "registry+https://github.com/rust-lang/crates.io-index"
386source = "registry+https://github.com/rust-lang/crates.io-index"
387−checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"
387+checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
388dependencies = [
388dependencies = [
389 "cfg-if",
389 "cfg-if",
390 "crc32fast",
390 "crc32fast",
@@ -452,9 +452,9 @@ dependencies = [
452
452
453[[package]]
453[[package]]
454name = "git2"
454name = "git2"
455−version = "0.14.2"
455+version = "0.13.25"
456source = "registry+https://github.com/rust-lang/crates.io-index"
456source = "registry+https://github.com/rust-lang/crates.io-index"
457−checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c"
457+checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6"
458dependencies = [
458dependencies = [
459 "bitflags",
459 "bitflags",
460 "libc",
460 "libc",
@@ -580,17 +580,23 @@ version = "1.4.0"
580source = "registry+https://github.com/rust-lang/crates.io-index"
580source = "registry+https://github.com/rust-lang/crates.io-index"
581checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
581checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
582
582
583+[[package]]
584+name = "lazycell"
585+version = "1.3.0"
586+source = "registry+https://github.com/rust-lang/crates.io-index"
587+checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
588+
583[[package]]
589[[package]]
584name = "libc"
590name = "libc"
585−version = "0.2.125"
591+version = "0.2.112"
586source = "registry+https://github.com/rust-lang/crates.io-index"
592source = "registry+https://github.com/rust-lang/crates.io-index"
587−checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
593+checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
588
594
589[[package]]
595[[package]]
590name = "libgit2-sys"
596name = "libgit2-sys"
591−version = "0.13.2+1.4.2"
597+version = "0.12.26+1.3.0"
592source = "registry+https://github.com/rust-lang/crates.io-index"
598source = "registry+https://github.com/rust-lang/crates.io-index"
593−checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b"
599+checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494"
594dependencies = [
600dependencies = [
595 "cc",
601 "cc",
596 "libc",
602 "libc",
@@ -655,24 +661,36 @@ version = "2.4.1"
655source = "registry+https://github.com/rust-lang/crates.io-index"
661source = "registry+https://github.com/rust-lang/crates.io-index"
656checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
662checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
657
663
664+[[package]]
665+name = "memoffset"
666+version = "0.6.5"
667+source = "registry+https://github.com/rust-lang/crates.io-index"
668+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
669+dependencies = [
670+ "autocfg",
671+]
672+
658[[package]]
673[[package]]
659name = "miniz_oxide"
674name = "miniz_oxide"
660−version = "0.5.1"
675+version = "0.4.4"
661source = "registry+https://github.com/rust-lang/crates.io-index"
676source = "registry+https://github.com/rust-lang/crates.io-index"
662−checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
677+checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
663dependencies = [
678dependencies = [
664 "adler",
679 "adler",
680+ "autocfg",
665]
681]
666
682
667[[package]]
683[[package]]
668name = "nix"
684name = "nix"
669−version = "0.24.1"
685+version = "0.23.1"
670source = "registry+https://github.com/rust-lang/crates.io-index"
686source = "registry+https://github.com/rust-lang/crates.io-index"
671−checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"
687+checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
672dependencies = [
688dependencies = [
673 "bitflags",
689 "bitflags",
690+ "cc",
674 "cfg-if",
691 "cfg-if",
675 "libc",
692 "libc",
693+ "memoffset",
676]
694]
677
695
678[[package]]
696[[package]]
@@ -692,9 +710,9 @@ dependencies = [
692
710
693[[package]]
711[[package]]
694name = "once_cell"
712name = "once_cell"
695−version = "1.10.0"
713+version = "1.9.0"
696source = "registry+https://github.com/rust-lang/crates.io-index"
714source = "registry+https://github.com/rust-lang/crates.io-index"
697−checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
715+checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
698
716
699[[package]]
717[[package]]
700name = "onig"
718name = "onig"
@@ -780,9 +798,9 @@ dependencies = [
780
798
781[[package]]
799[[package]]
782name = "predicates"
800name = "predicates"
783−version = "2.1.1"
801+version = "2.1.0"
784source = "registry+https://github.com/rust-lang/crates.io-index"
802source = "registry+https://github.com/rust-lang/crates.io-index"
785−checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c"
803+checksum = "95e5a7689e456ab905c22c2b48225bb921aba7c8dfa58440d68ba13f6222a715"
786dependencies = [
804dependencies = [
787 "difflib",
805 "difflib",
788 "float-cmp",
806 "float-cmp",
@@ -808,30 +826,6 @@ dependencies = [
808 "termtree",
826 "termtree",
809]
827]
810
828
811−[[package]]
812−name = "proc-macro-error"
813−version = "1.0.4"
814−source = "registry+https://github.com/rust-lang/crates.io-index"
815−checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
816−dependencies = [
817− "proc-macro-error-attr",
818− "proc-macro2",
819− "quote",
820− "syn",
821− "version_check",
822−]
823−
824−[[package]]
825−name = "proc-macro-error-attr"
826−version = "1.0.4"
827−source = "registry+https://github.com/rust-lang/crates.io-index"
828−checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
829−dependencies = [
830− "proc-macro2",
831− "quote",
832− "version_check",
833−]
834−
835[[package]]
829[[package]]
836name = "proc-macro-hack"
830name = "proc-macro-hack"
837version = "0.5.19"
831version = "0.5.19"
@@ -877,9 +871,9 @@ dependencies = [
877
871
878[[package]]
872[[package]]
879name = "regex"
873name = "regex"
880−version = "1.5.5"
874+version = "1.5.4"
881source = "registry+https://github.com/rust-lang/crates.io-index"
875source = "registry+https://github.com/rust-lang/crates.io-index"
882−checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
876+checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
883dependencies = [
877dependencies = [
884 "aho-corasick",
878 "aho-corasick",
885 "memchr",
879 "memchr",
@@ -916,12 +910,6 @@ dependencies = [
916 "bytemuck",
910 "bytemuck",
917]
911]
918
912
919−[[package]]
920−name = "rustversion"
921−version = "1.0.6"
922−source = "registry+https://github.com/rust-lang/crates.io-index"
923−checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
924−
925[[package]]
913[[package]]
926name = "ryu"
914name = "ryu"
927version = "1.0.9"
915version = "1.0.9"
@@ -951,9 +939,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
951
939
952[[package]]
940[[package]]
953name = "semver"
941name = "semver"
954−version = "1.0.7"
942+version = "1.0.4"
955source = "registry+https://github.com/rust-lang/crates.io-index"
943source = "registry+https://github.com/rust-lang/crates.io-index"
956−checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4"
944+checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
957
945
958[[package]]
946[[package]]
959name = "serde"
947name = "serde"
@@ -1000,9 +988,9 @@ dependencies = [
1000
988
1001[[package]]
989[[package]]
1002name = "serial_test"
990name = "serial_test"
1003−version = "0.6.0"
991+version = "0.5.1"
1004source = "registry+https://github.com/rust-lang/crates.io-index"
992source = "registry+https://github.com/rust-lang/crates.io-index"
1005−checksum = "e5bcc41d18f7a1d50525d080fd3e953be87c4f9f1a974f3c21798ca00d54ec15"
993+checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d"
1006dependencies = [
994dependencies = [
1007 "lazy_static",
995 "lazy_static",
1008 "parking_lot",
996 "parking_lot",
@@ -1011,14 +999,12 @@ dependencies = [
1011
999
1012[[package]]
1000[[package]]
1013name = "serial_test_derive"
1001name = "serial_test_derive"
1014−version = "0.6.0"
1002+version = "0.5.1"
1015source = "registry+https://github.com/rust-lang/crates.io-index"
1003source = "registry+https://github.com/rust-lang/crates.io-index"
1016−checksum = "2881bccd7d60fb32dfa3d7b3136385312f8ad75e2674aab2852867a09790cae8"
1004+checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5"
1017dependencies = [
1005dependencies = [
1018− "proc-macro-error",
1019 "proc-macro2",
1006 "proc-macro2",
1020 "quote",
1007 "quote",
1021− "rustversion",
1022 "syn",
1008 "syn",
1023]
1009]
1024
1010
@@ -1030,9 +1016,9 @@ checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
1030
1016
1031[[package]]
1017[[package]]
1032name = "shell-words"
1018name = "shell-words"
1033−version = "1.1.0"
1019+version = "1.0.0"
1034source = "registry+https://github.com/rust-lang/crates.io-index"
1020source = "registry+https://github.com/rust-lang/crates.io-index"
1035−checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
1021+checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
1036
1022
1037[[package]]
1023[[package]]
1038name = "smallvec"
1024name = "smallvec"
@@ -1065,9 +1051,9 @@ dependencies = [
1065
1051
1066[[package]]
1052[[package]]
1067name = "syntect"
1053name = "syntect"
1068−version = "5.0.0"
1054+version = "4.6.0"
1069source = "registry+https://github.com/rust-lang/crates.io-index"
1055source = "registry+https://github.com/rust-lang/crates.io-index"
1070−checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8"
1056+checksum = "8b20815bbe80ee0be06e6957450a841185fcf690fe0178f14d77a05ce2caa031"
1071dependencies = [
1057dependencies = [
1072 "bincode",
1058 "bincode",
1073 "bitflags",
1059 "bitflags",
@@ -1075,14 +1061,13 @@ dependencies = [
1075 "flate2",
1061 "flate2",
1076 "fnv",
1062 "fnv",
1077 "lazy_static",
1063 "lazy_static",
1078− "once_cell",
1064+ "lazycell",
1079 "onig",
1065 "onig",
1080 "plist",
1066 "plist",
1081 "regex-syntax",
1067 "regex-syntax",
1082 "serde",
1068 "serde",
1083 "serde_derive",
1069 "serde_derive",
1084 "serde_json",
1070 "serde_json",
1085− "thiserror",
1086 "walkdir",
1071 "walkdir",
1087 "yaml-rust",
1072 "yaml-rust",
1088]
1073]
@@ -1158,18 +1143,18 @@ dependencies = [
1158
1143
1159[[package]]
1144[[package]]
1160name = "thiserror"
1145name = "thiserror"
1161−version = "1.0.31"
1146+version = "1.0.30"
1162source = "registry+https://github.com/rust-lang/crates.io-index"
1147source = "registry+https://github.com/rust-lang/crates.io-index"
1163−checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
1148+checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
1164dependencies = [
1149dependencies = [
1165 "thiserror-impl",
1150 "thiserror-impl",
1166]
1151]
1167
1152
1168[[package]]
1153[[package]]
1169name = "thiserror-impl"
1154name = "thiserror-impl"
1170−version = "1.0.31"
1155+version = "1.0.30"
1171source = "registry+https://github.com/rust-lang/crates.io-index"
1156source = "registry+https://github.com/rust-lang/crates.io-index"
1172−checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
1157+checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
1173dependencies = [
1158dependencies = [
1174 "proc-macro2",
1159 "proc-macro2",
1175 "quote",
1160 "quote",
@@ -1252,12 +1237,6 @@ version = "0.8.2"
1252source = "registry+https://github.com/rust-lang/crates.io-index"
1237source = "registry+https://github.com/rust-lang/crates.io-index"
1253checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1238checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1254
1239
1255−[[package]]
1256−name = "version_check"
1257−version = "0.9.4"
1258−source = "registry+https://github.com/rust-lang/crates.io-index"
1259−checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
1260−
1261[[package]]
1240[[package]]
1262name = "wait-timeout"
1241name = "wait-timeout"
1263version = "0.2.0"
1242version = "0.2.0"
Cargo.toml+12−11
@@ -6,7 +6,7 @@ homepage = "https://github.com/sharkdp/bat"
6license = "MIT/Apache-2.0"
6license = "MIT/Apache-2.0"
7name = "bat"
7name = "bat"
8repository = "https://github.com/sharkdp/bat"
8repository = "https://github.com/sharkdp/bat"
9−version = "0.21.0"
9+version = "0.19.0"
10exclude = ["assets/syntaxes/*", "assets/themes/*"]
10exclude = ["assets/syntaxes/*", "assets/themes/*"]
11build = "build.rs"
11build = "build.rs"
12edition = '2018'
12edition = '2018'
@@ -33,7 +33,8 @@ minimal-application = [
33]
33]
34git = ["git2"] # Support indicating git modifications
34git = ["git2"] # Support indicating git modifications
35paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
35paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
36+# Add "syntect/plist-load" when https://github.com/trishume/syntect/pull/345 reaches us
36−build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]
37+build-assets = ["syntect/yaml-load", "syntect/dump-create", "regex", "walkdir"]
37
38
38# You need to use one of these if you depend on bat as a library:
39# You need to use one of these if you depend on bat as a library:
39regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
40regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
@@ -46,12 +47,12 @@ ansi_colours = "^1.1"
46bincode = "1.0"
47bincode = "1.0"
47console = "0.15.0"
48console = "0.15.0"
48flate2 = "1.0"
49flate2 = "1.0"
49−once_cell = "1.10"
50+once_cell = "1.9"
50thiserror = "1.0"
51thiserror = "1.0"
51wild = { version = "2.0", optional = true }
52wild = { version = "2.0", optional = true }
52content_inspector = "0.2.4"
53content_inspector = "0.2.4"
53encoding = "0.2"
54encoding = "0.2"
54−shell-words = { version = "1.1.0", optional = true }
55+shell-words = { version = "1.0.0", optional = true }
55unicode-width = "0.1.9"
56unicode-width = "0.1.9"
56globset = "0.4"
57globset = "0.4"
57serde = { version = "1.0", features = ["derive"] }
58serde = { version = "1.0", features = ["derive"] }
@@ -59,20 +60,20 @@ serde_yaml = "0.8"
59semver = "1.0"
60semver = "1.0"
60path_abs = { version = "0.5", default-features = false }
61path_abs = { version = "0.5", default-features = false }
61clircle = "0.3"
62clircle = "0.3"
62−bugreport = { version = "0.5.0", optional = true }
63+bugreport = { version = "0.4", optional = true }
63dirs-next = { version = "2.0.0", optional = true }
64dirs-next = { version = "2.0.0", optional = true }
64grep-cli = { version = "0.1.6", optional = true }
65grep-cli = { version = "0.1.6", optional = true }
65−regex = { version = "1.5.5", optional = true }
66+regex = { version = "1.0", optional = true }
66walkdir = { version = "2.0", optional = true }
67walkdir = { version = "2.0", optional = true }
67bytesize = { version = "1.1.0" }
68bytesize = { version = "1.1.0" }
68
69
69[dependencies.git2]
70[dependencies.git2]
70−version = "0.14"
71+version = "0.13"
71optional = true
72optional = true
72default-features = false
73default-features = false
73
74
74[dependencies.syntect]
75[dependencies.syntect]
75−version = "5.0.0"
76+version = "4.6.0"
76default-features = false
77default-features = false
77features = ["parsing"]
78features = ["parsing"]
78
79
@@ -84,13 +85,13 @@ features = ["suggestions", "color", "wrap_help"]
84
85
85[dev-dependencies]
86[dev-dependencies]
86assert_cmd = "2.0.4"
87assert_cmd = "2.0.4"
87−serial_test = "0.6.0"
88+serial_test = "0.5.1"
88−predicates = "2.1.1"
89+predicates = "2.1.0"
89wait-timeout = "0.2.0"
90wait-timeout = "0.2.0"
90tempfile = "3.3.0"
91tempfile = "3.3.0"
91
92
92[target.'cfg(unix)'.dev-dependencies]
93[target.'cfg(unix)'.dev-dependencies]
93−nix = { version = "0.24.1", default-features = false, features = ["term"] }
94+nix = "0.23.1"
94
95
95[build-dependencies]
96[build-dependencies]
96clap = { version = "2.34", optional = true }
97clap = { version = "2.34", optional = true }
README.md+26−30
@@ -7,6 +7,7 @@
7</p>
7</p>
8
8
9<p align="center">
9<p align="center">
10+ <a href="#sponsors">Sponsors</a> •
10 <a href="#syntax-highlighting">Key Features</a> •
11 <a href="#syntax-highlighting">Key Features</a> •
11 <a href="#how-to-use">How To Use</a> •
12 <a href="#how-to-use">How To Use</a> •
12 <a href="#installation">Installation</a> •
13 <a href="#installation">Installation</a> •
@@ -20,17 +21,30 @@
20</p>
21</p>
21
22
22### Sponsors
23### Sponsors
23−
24+<p align="center">
24−A special *thank you* goes to our biggest <a href="doc/sponsors.md">sponsors</a>:<br>
25+ and now, a word from our sponsors:
25−<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=bat&utm_source=github">
26+ <a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=bat&utm_source=github">
27+ <div>
26− <img src="doc/sponsors/workos-logo-white-bg.svg" width="200" alt="WorkOS">
28+ <img src="doc/sponsors/workos-logo-white-bg.svg" width="200" alt="WorkOS">
27− <br>
29+ </div>
28− <strong>Your app, enterprise-ready.</strong>
30+ <strong>Your app, enterprise-ready.</strong>
29− <br>
31+ <div>
30− <sub>Start selling to enterprise customers with just a few lines of code.</sub>
32+ <sub>Start selling to enterprise customers with just a few lines of code.</sub>
31− <br>
33+ <br>
32− <sup>Add Single Sign-On (and more) in minutes instead of months.</sup>
34+ <sup>Add Single Sign-On (and more) in minutes instead of months.</sup>
33−</a>
35+ </div>
36+ </a>
37+
38+ <div>
39+ Please note, that being sponsored does not affect the individuality of the `bat`
40+ project or affect the maintainers' actions in any way. We remain impartial and
41+ continue to assess pull requests solely on merit - the features added, bugs
42+ solved, and effect on the overall complexity of the code. No issue will have a
43+ different priority based on sponsorship status of the reporter.
44+ </div>
45+
46+ If you are interested to learn more, see our [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.
47+</p>
34
48
35### Syntax highlighting
49### Syntax highlighting
36
50
@@ -171,7 +185,7 @@ You can combine `bat` with `git diff` to view lines around code changes with pro
171highlighting:
185highlighting:
172```bash
186```bash
173batdiff() {
187batdiff() {
174− git diff --name-only --relative --diff-filter=d | xargs bat --diff
188+ git diff --name-only --diff-filter=d | xargs bat --diff
175}
189}
176```
190```
177If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
191If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
@@ -212,24 +226,6 @@ Also, note that this will [not work](https://github.com/sharkdp/bat/issues/1145)
212
226
213The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
227The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
214
228
215−#### Highlighting `--help` messages
216−
217−You can use `bat` to colorize help text: `$ cp --help | bat -plhelp`
218−
219−You can also use a wrapper around this:
220−
221−```bash
222−# in your .bashrc/.zshrc/*rc
223−alias bathelp='bat --plain --language=help'
224−help() {
225− "$@" --help 2>&1 | bathelp
226−}
227−```
228−
229−Then you can do `$ help cp` or `$ help git commit`.
230−
231−Please report any issues with the help syntax in [this repository](https://github.com/victor-gp/cmd-help-sublime-syntax).
232−
233
229
234## Installation
230## Installation
235
231
assets/acknowledgements.bin

Binary file not shown.

assets/completions/_bat.ps1.in+1−1
@@ -37,7 +37,7 @@ Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -Script
37 [CompletionResult]::new('-m', 'm', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
37 [CompletionResult]::new('-m', 'm', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
38 [CompletionResult]::new('--map-syntax', 'map-syntax', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
38 [CompletionResult]::new('--map-syntax', 'map-syntax', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
39 [CompletionResult]::new('--theme', 'theme', [CompletionResultType]::ParameterName, 'Set the color theme for syntax highlighting.')
39 [CompletionResult]::new('--theme', 'theme', [CompletionResultType]::ParameterName, 'Set the color theme for syntax highlighting.')
40− [CompletionResult]::new('--style', 'style', [CompletionResultType]::ParameterName, 'Comma-separated list of style elements to display (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).')
40+ [CompletionResult]::new('--style', 'style', [CompletionResultType]::ParameterName, 'Comma-separated list of style elements to display (*auto*, full, plain, changes, header, grid, rule, numbers, snip).')
41 [CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
41 [CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
42 [CompletionResult]::new('--line-range', 'line-range', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
42 [CompletionResult]::new('--line-range', 'line-range', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
43 [CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
43 [CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
assets/completions/bat.bash.in+2−15
@@ -2,22 +2,9 @@
2
2
3# Requires https://github.com/scop/bash-completion
3# Requires https://github.com/scop/bash-completion
4
4
5−# Macs have bash3 for which the bash-completion package doesn't include
6−# _init_completion. This is a minimal version of that function.
7−__bat_init_completion()
8−{
9− COMPREPLY=()
10− _get_comp_words_by_ref "$@" cur prev words cword
11−}
12−
13_bat() {
5_bat() {
14− local cur prev words cword split=false
6+ local cur prev words cword split
15− if declare -F _init_completion >/dev/null 2>&1; then
16− _init_completion -s || return 0
7+ _init_completion -s || return 0
17− else
18− __bat_init_completion -n "=" || return 0
19− _split_longopt && split=true
20− fi
21
8
22 if [[ ${words[1]-} == cache ]]; then
9 if [[ ${words[1]-} == cache ]]; then
23 case $prev in
10 case $prev in
assets/completions/bat.fish.in+1−1
@@ -56,7 +56,7 @@ complete -c {{PROJECT_EXECUTABLE}} -s P -d "Disable paging. Alias for '--paging=
56
56
57complete -c {{PROJECT_EXECUTABLE}} -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
57complete -c {{PROJECT_EXECUTABLE}} -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
58
58
59−complete -c {{PROJECT_EXECUTABLE}} -l style -xka "default auto full plain changes header header-filename header-filesize grid rule numbers snip" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
59+complete -c {{PROJECT_EXECUTABLE}} -l style -xka "auto full plain changes header grid rule numbers snip" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
60
60
61complete -c {{PROJECT_EXECUTABLE}} -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
61complete -c {{PROJECT_EXECUTABLE}} -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
62
62
assets/completions/bat.zsh.in+1−1
@@ -75,7 +75,7 @@ _{{PROJECT_EXECUTABLE}}_main() {
75 ;;
75 ;;
76
76
77 style)
77 style)
78− _values -s , 'style' default auto full plain changes header header-filename header-filesize grid rule numbers snip
78+ _values -s , 'style' auto full plain changes header grid rule numbers snip
79 ;;
79 ;;
80 esac
80 esac
81}
81}
assets/manual/bat.1.in+1−2
@@ -146,8 +146,7 @@ Configure which elements (line numbers, file headers, grid borders, Git modifica
146of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
146of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
147To set a default style, add the '\-\-style=".."' option to the configuration file or
147To set a default style, add the '\-\-style=".."' option to the configuration file or
148export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
148export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
149−values: *default*, full, auto, plain, changes, header, header-filename, header-filesize, grid,
149+values: *full*, auto, plain, changes, header, grid, rule, numbers, snip.
150−rule, numbers, snip.
151.HP
150.HP
152\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
151\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
153.IP
152.IP
assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/02_Extra/Fish+1−1

Submodule changed.

assets/syntaxes/02_Extra/INI.sublime-syntax+2−2
@@ -5,8 +5,8 @@ name: INI
5file_extensions:
5file_extensions:
6 - ini
6 - ini
7 - INI
7 - INI
8− - "inf"
8+ - inf
9− - "INF"
9+ - INF
10 - reg
10 - reg
11 - REG
11 - REG
12 - lng
12 - lng
assets/syntaxes/02_Extra/Nginx+1−1

Submodule changed.

assets/syntaxes/02_Extra/SublimeJQdeleted−1

Submodule changed.

assets/syntaxes/02_Extra/Zig+1−1

Submodule changed.

assets/syntaxes/02_Extra/cmd-helpdeleted−1

Submodule changed.

assets/syntaxes/02_Extra/log.sublime-syntax+6−30
@@ -6,7 +6,6 @@ file_extensions:
6scope: text.log
6scope: text.log
7variables:
7variables:
8 ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
8 ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
9− hours_minutes_seconds: (?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)
10contexts:
9contexts:
11 main:
10 main:
12 - match: (\w+)(=)
11 - match: (\w+)(=)
@@ -18,10 +17,11 @@ contexts:
18 captures:
17 captures:
19 1: punctuation.definition.string.begin.log
18 1: punctuation.definition.string.begin.log
20 3: punctuation.definition.string.end.log
19 3: punctuation.definition.string.end.log
21− - match: \"
20+ - match: (")([^"]*)(")
21+ scope: string.quoted.double.log
22 captures:
22 captures:
23 1: punctuation.definition.string.begin.log
23 1: punctuation.definition.string.begin.log
24− push: double_quoted_string
24+ 3: punctuation.definition.string.end.log
25 - include: dates
25 - include: dates
26 - include: ip_addresses
26 - include: ip_addresses
27 - include: numbers
27 - include: numbers
@@ -29,34 +29,19 @@ contexts:
29 scope: markup.error.log
29 scope: markup.error.log
30 - match: \b(?i:warn(?:ing)?)\b
30 - match: \b(?i:warn(?:ing)?)\b
31 scope: markup.warning.log
31 scope: markup.warning.log
32− - match: \b(?i:debug)\b
33− scope: markup.info.log
34 #- include: scope:text.html.markdown#autolink-inet
32 #- include: scope:text.html.markdown#autolink-inet
35 - match: \b\w+:/{2,3}
33 - match: \b\w+:/{2,3}
36 scope: markup.underline.link.scheme.log
34 scope: markup.underline.link.scheme.log
37 push: url-host
35 push: url-host
38 dates:
36 dates:
39− - match: \b\d{4}-\d{2}-\d{2}(?=\b|T)
37+ - match: \b\d{4}-\d{2}-\d{2}\b
40 scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
38 scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
41− push: maybe_date_time_separator
42− - match: \b\d{4}/\d{2}/\d{2}(?=\b|T)
39+ - match: \b\d{4}/\d{2}/\d{2}\b
43 scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
40 scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
44− push: maybe_date_time_separator
41+ - match: \b(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)(?:(\.)\d{3})?\b
45− - match: \b(?={{hours_minutes_seconds}})
46− push: time
47− time:
48− - match: (?:{{hours_minutes_seconds}})(?:(\.)\d{3})?\b
49 scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log
42 scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log
50 captures:
43 captures:
51 1: punctuation.separator.decimal.log
44 1: punctuation.separator.decimal.log
52− - match: ''
53− pop: true
54− maybe_date_time_separator:
55− - match: T(?={{hours_minutes_seconds}})
56− scope: meta.date.log meta.time.log keyword.other.log
57− set: time
58− - match: ''
59− pop: true
60 ip_addresses:
45 ip_addresses:
61 - match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b)
46 - match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b)
62 push:
47 push:
@@ -129,12 +114,3 @@ contexts:
129 scope: markup.underline.link.path.log
114 scope: markup.underline.link.path.log
130 - match: ''
115 - match: ''
131 pop: true
116 pop: true
132− double_quoted_string:
133− - meta_scope: string.quoted.double.log
134− - match: \\"
135− scope: constant.character.escape.log
136− - match: \\n
137− scope: constant.character.escape.log
138− - match: \"
139− scope: punctuation.definition.string.end.log
140− pop: true
assets/themes.bin

Binary file not shown.

doc/README-ja.md+1−1
@@ -181,7 +181,7 @@ man 2 select
181
181
182## インストール
182## インストール
183
183
184−[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
184+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
185
185
186### On Ubuntu (`apt` を使用)
186### On Ubuntu (`apt` を使用)
187*... や他のDebianベースのLinuxディストリビューション*
187*... や他のDebianベースのLinuxディストリビューション*
doc/README-ru.md+1−1
@@ -160,7 +160,7 @@ man 2 select
160
160
161## Установка
161## Установка
162
162
163−[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
163+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
164
164
165### Ubuntu (с помощью `apt`)
165### Ubuntu (с помощью `apt`)
166*... и другие дистрибутивы основанные на Debian.*
166*... и другие дистрибутивы основанные на Debian.*
doc/release-checklist.md+18−28
@@ -1,5 +1,16 @@
1# Release checklist
1# Release checklist
2
2
3+## Dependencies
4+
5+See this page for a good overview: https://deps.rs/repo/github/sharkdp/bat
6+
7+- [ ] Optional: update dependencies with `cargo update`. This is also done by
8+ dependabot, so it is not strictly necessary.
9+- [ ] Install [cargo-outdated](https://crates.io/crates/cargo-outdated). Check
10+ for outdated dependencies with `cargo outdated --root-deps-only` and
11+ decide for each of them whether we want to (manually) upgrade. This will
12+ require changes to `Cargo.toml`.
13+
3## Version bump
14## Version bump
4
15
5- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
16- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
@@ -7,22 +18,21 @@
7- [ ] Find the current min. supported Rust version by running
18- [ ] Find the current min. supported Rust version by running
8 `grep '^\s*MIN_SUPPORTED_RUST_VERSION' .github/workflows/CICD.yml`.
19 `grep '^\s*MIN_SUPPORTED_RUST_VERSION' .github/workflows/CICD.yml`.
9- [ ] Update the version and the min. supported Rust version in `README.md` and
20- [ ] Update the version and the min. supported Rust version in `README.md` and
10− `doc/README-*.md`. Check with
21+ `doc/README-*.md`. Check with `git grep -i 'rust.*1\.'` and
11− `git grep -i -e 'rust.*1\.' -e '1\..*rust' | grep README | grep -v tests/`.
22+ `git grep -i '1\..*rust'`.
12- [ ] Update `CHANGELOG.md`. Introduce a section for the new release.
23- [ ] Update `CHANGELOG.md`. Introduce a section for the new release.
13
24
14## Update syntaxes and themes (build assets)
25## Update syntaxes and themes (build assets)
15
26
16−- [ ] Install the latest master version (`cargo clean && cargo install --locked -f --path .`) and make
27+- [ ] Install the latest master version (`cargo install -f --path .`) and make
17 sure that it is available on the `PATH` (`bat --version` should show the
28 sure that it is available on the `PATH` (`bat --version` should show the
18 new version).
29 new version).
19- [ ] Run `assets/create.sh` and check in the binary asset files.
30- [ ] Run `assets/create.sh` and check in the binary asset files.
20
31
21## Documentation
32## Documentation
22
33
23−- [ ] Review `-h`, `--help`, and the `man` page. All of these are shown in
34+- [ ] Review the `-h` and `--help` texts
24− the output of the CI job called *Documentation*, so look there.
35+- [ ] Review the `man` page
25− The CI workflow corresponding to the tip of the master branch is a good place to look.
26
36
27## Pre-release checks
37## Pre-release checks
28
38
@@ -31,14 +41,13 @@
31- [ ] Optional: manually test the new features and command-line options. To do
41- [ ] Optional: manually test the new features and command-line options. To do
32 this, install the latest `bat` version again (to include the new syntaxes
42 this, install the latest `bat` version again (to include the new syntaxes
33 and themes).
43 and themes).
34−- [ ] Run `cargo publish --dry-run` to make sure that it will
44+- [ ] Run `cargo publish --dry-run --allow-dirty` to make sure that it will
35 succeed later (after creating the GitHub release).
45 succeed later (after creating the GitHub release).
36
46
37## Release
47## Release
38
48
39- [ ] Create a tag and push it: `git tag vX.Y.Z; git push origin tag vX.Y.Z`.
49- [ ] Create a tag and push it: `git tag vX.Y.Z; git push origin tag vX.Y.Z`.
40 This will trigger the deployment via GitHub Actions.
50 This will trigger the deployment via GitHub Actions.
41− REMINDER: If your `origin` is a fork, don't forget to push to e.g. `upstream` instead!
42- [ ] Go to https://github.com/sharkdp/bat/releases/new to create the new
51- [ ] Go to https://github.com/sharkdp/bat/releases/new to create the new
43 release. Select the new tag and also use it as the release title. For the
52 release. Select the new tag and also use it as the release title. For the
44 release notes, copy the corresponding section from `CHANGELOG.md` and
53 release notes, copy the corresponding section from `CHANGELOG.md` and
@@ -51,23 +60,4 @@
51
60
52## Post-release
61## Post-release
53
62
54−- [ ] Prepare a new "unreleased" section at the top of `CHANGELOG.md`.
63+- [ ] Prepare a new (empty) "unreleased" section at the top of `CHANGELOG.md`.
55− Put this at the top:
56−
57−```
58−# unreleased
59−
60−## Features
61−
62−## Bugfixes
63−
64−## Other
65−
66−## Syntaxes
67−
68−## Themes
69−
70−## `bat` as a library
71−
72−
73−```
doc/sponsors.mddeleted−14
@@ -1,14 +0,0 @@
1−## Sponsors
2−
3−`bat` development is sponsored by many individuals and companies. Thank you very much!
4−
5−Please note, that being sponsored does not affect the individuality of the `bat`
6−project or affect the maintainers' actions in any way.
7−We remain impartial and continue to assess pull requests solely on merit - the
8−features added, bugs solved, and effect on the overall complexity of the code.
9−No issue will have a different priority based on sponsorship status of the
10−reporter.
11−
12−Contributions from anybody are most welcomed, please see our [`CONTRIBUTING.md`](../CONTRIBUTING.md) guide.
13−
14−If you want to see our biggest sponsors, check the top of [`README.md`](../README.md#sponsors).
rustfmt.tomldeleted−1
@@ -1 +0,0 @@
1−# Defaults are used
src/assets.rs+4−71
@@ -43,9 +43,8 @@ pub struct SyntaxReferenceInSet<'a> {
43 pub syntax_set: &'a SyntaxSet,
43 pub syntax_set: &'a SyntaxSet,
44}
44}
45
45
46−/// Lazy-loaded syntaxes are already compressed, and we don't want to compress
46+/// Compress for size of ~700 kB instead of ~4600 kB at the cost of ~30% longer deserialization time
47−/// already compressed data.
48−pub(crate) const COMPRESS_SYNTAXES: bool = false;
47+pub(crate) const COMPRESS_SYNTAXES: bool = true;
49
48
50/// We don't want to compress our [LazyThemeSet] since the lazy-loaded themes
49/// We don't want to compress our [LazyThemeSet] since the lazy-loaded themes
51/// within it are already compressed, and compressing another time just makes
50/// within it are already compressed, and compressing another time just makes
@@ -69,57 +68,10 @@ impl HighlightingAssets {
69 }
68 }
70 }
69 }
71
70
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.
93 pub fn default_theme() -> &'static str {
71 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 {
112 "Monokai Extended"
72 "Monokai Extended"
113 }
73 }
114
74
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−
123 pub fn from_cache(cache_path: &Path) -> Result<Self> {
75 pub fn from_cache(cache_path: &Path) -> Result<Self> {
124 Ok(HighlightingAssets::new(
76 Ok(HighlightingAssets::new(
125 SerializedSyntaxSet::FromFile(cache_path.join("syntaxes.bin")),
77 SerializedSyntaxSet::FromFile(cache_path.join("syntaxes.bin")),
@@ -399,16 +351,6 @@ fn asset_from_cache<T: serde::de::DeserializeOwned>(
399 .map_err(|_| format!("Could not parse cached {}", description).into())
351 .map_err(|_| format!("Could not parse cached {}", description).into())
400}
352}
401
353
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−
412#[cfg(test)]
354#[cfg(test)]
413mod tests {
355mod tests {
414 use super::*;
356 use super::*;
@@ -639,22 +581,13 @@ mod tests {
639 }
581 }
640
582
641 #[test]
583 #[test]
642− fn syntax_detection_is_case_insensitive() {
584+ fn syntax_detection_is_case_sensitive() {
643 let mut test = SyntaxDetectionTest::new();
585 let mut test = SyntaxDetectionTest::new();
644
586
645− assert_eq!(test.syntax_for_file("README.md"), "Markdown");
646− assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
647− assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
648− assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
587+ assert_ne!(test.syntax_for_file("README.MD"), "Markdown");
649−
650− // Adding a mapping for "MD" in addition to "md" should not break the mapping
651 test.syntax_mapping
588 test.syntax_mapping
652 .insert("*.MD", MappingTarget::MapTo("Markdown"))
589 .insert("*.MD", MappingTarget::MapTo("Markdown"))
653 .ok();
590 .ok();
654−
655− assert_eq!(test.syntax_for_file("README.md"), "Markdown");
656− assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
657− assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
658 assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
591 assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
659 }
592 }
660
593
src/bin/bat/app.rs+1−1
@@ -322,7 +322,7 @@ impl App {
322 .collect::<Vec<_>>()
322 .collect::<Vec<_>>()
323 })
323 })
324 .or(env_style_components)
324 .or(env_style_components)
325− .unwrap_or_else(|| vec![StyleComponent::Default])
325+ .unwrap_or_else(|| vec![StyleComponent::Full])
326 .into_iter()
326 .into_iter()
327 .map(|style| style.components(self.interactive_output))
327 .map(|style| style.components(self.interactive_output))
328 .fold(HashSet::new(), |mut acc, components| {
328 .fold(HashSet::new(), |mut acc, components| {
src/bin/bat/clap_app.rs+3−5
@@ -398,7 +398,6 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
398 !&[
398 !&[
399 "auto",
399 "auto",
400 "full",
400 "full",
401− "default",
402 "plain",
401 "plain",
403 "header",
402 "header",
404 "header-filename",
403 "header-filename",
@@ -420,7 +419,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
420 })
419 })
421 .help(
420 .help(
422 "Comma-separated list of style elements to display \
421 "Comma-separated list of style elements to display \
423− (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).",
422+ (*auto*, full, plain, changes, header, grid, rule, numbers, snip).",
424 )
423 )
425 .long_help(
424 .long_help(
426 "Configure which elements (line numbers, file headers, grid \
425 "Configure which elements (line numbers, file headers, grid \
@@ -431,9 +430,8 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
431 '--style=\"..\"' option to the configuration file or export the \
430 '--style=\"..\"' option to the configuration file or export the \
432 BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
431 BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
433 Possible values:\n\n \
432 Possible values:\n\n \
434− * default: enables recommended style components (default).\n \
435− * full: enables all available components.\n \
433+ * full: enables all available components (default).\n \
436− * auto: same as 'default', unless the output is piped.\n \
434+ * auto: same as 'full', unless the output is piped.\n \
437 * plain: disables all available components.\n \
435 * plain: disables all available components.\n \
438 * changes: show Git modification markers.\n \
436 * changes: show Git modification markers.\n \
439 * header: alias for 'header-filename'.\n \
437 * header: alias for 'header-filename'.\n \
src/bin/bat/config.rs+1−1
@@ -91,7 +91,7 @@ pub fn get_args_from_config_file() -> Result<Vec<OsString>, shell_words::ParseEr
91 .ok()
91 .ok()
92 .map(|content| get_args_from_str(&content))
92 .map(|content| get_args_from_str(&content))
93 .transpose()?
93 .transpose()?
94− .unwrap_or_default())
94+ .unwrap_or_else(Vec::new))
95}
95}
96
96
97pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
97pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
src/bin/bat/main.rs−11
@@ -230,9 +230,6 @@ fn invoke_bugreport(app: &App) {
230 let pager = bat::config::get_pager_executable(app.matches.value_of("pager"))
230 let pager = bat::config::get_pager_executable(app.matches.value_of("pager"))
231 .unwrap_or_else(|| "less".to_owned()); // FIXME: Avoid non-canonical path to "less".
231 .unwrap_or_else(|| "less".to_owned()); // FIXME: Avoid non-canonical path to "less".
232
232
233− let mut custom_assets_metadata = PROJECT_DIRS.cache_dir().to_path_buf();
234− custom_assets_metadata.push("metadata.yaml");
235−
236 let mut report = bugreport!()
233 let mut report = bugreport!()
237 .info(SoftwareVersion::default())
234 .info(SoftwareVersion::default())
238 .info(OperatingSystem::default())
235 .info(OperatingSystem::default())
@@ -257,14 +254,6 @@ fn invoke_bugreport(app: &App) {
257 "MANPAGER",
254 "MANPAGER",
258 ]))
255 ]))
259 .info(FileContent::new("Config file", config_file()))
256 .info(FileContent::new("Config file", config_file()))
260− .info(FileContent::new(
261− "Custom assets metadata",
262− custom_assets_metadata,
263− ))
264− .info(DirectoryEntries::new(
265− "Custom assets",
266− PROJECT_DIRS.cache_dir(),
267− ))
268 .info(CompileTimeInformation::default());
257 .info(CompileTimeInformation::default());
269
258
270 #[cfg(feature = "paging")]
259 #[cfg(feature = "paging")]
src/error.rs+1−4
@@ -2,14 +2,11 @@ use std::io::Write;
2use thiserror::Error;
2use thiserror::Error;
3
3
4#[derive(Error, Debug)]
4#[derive(Error, Debug)]
5−#[non_exhaustive]
6pub enum Error {
5pub enum Error {
7 #[error(transparent)]
6 #[error(transparent)]
8 Io(#[from] ::std::io::Error),
7 Io(#[from] ::std::io::Error),
9 #[error(transparent)]
8 #[error(transparent)]
10− SyntectError(#[from] ::syntect::Error),
9+ SyntectError(#[from] ::syntect::LoadingError),
11− #[error(transparent)]
12− SyntectLoadingError(#[from] ::syntect::LoadingError),
13 #[error(transparent)]
10 #[error(transparent)]
14 ParseIntError(#[from] ::std::num::ParseIntError),
11 ParseIntError(#[from] ::std::num::ParseIntError),
15 #[error(transparent)]
12 #[error(transparent)]
src/input.rs+1−1
@@ -118,7 +118,7 @@ impl OpenedInput<'_> {
118 self.metadata
118 self.metadata
119 .user_provided_name
119 .user_provided_name
120 .as_ref()
120 .as_ref()
121− .or(match self.kind {
121+ .or_else(|| match self.kind {
122 OpenedInputKind::OrdinaryFile(ref path) => Some(path),
122 OpenedInputKind::OrdinaryFile(ref path) => Some(path),
123 _ => None,
123 _ => None,
124 })
124 })
src/less.rs+8−59
@@ -3,38 +3,21 @@
3use std::ffi::OsStr;
3use std::ffi::OsStr;
4use std::process::Command;
4use std::process::Command;
5
5
6−#[derive(Debug, PartialEq)]
7−pub enum LessVersion {
8− Less(usize),
9− BusyBox,
10−}
11−
12−pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<LessVersion> {
6+pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<usize> {
13 let resolved_path = grep_cli::resolve_binary(less_path.as_ref()).ok()?;
7 let resolved_path = grep_cli::resolve_binary(less_path.as_ref()).ok()?;
14
8
15 let cmd = Command::new(resolved_path).arg("--version").output().ok()?;
9 let cmd = Command::new(resolved_path).arg("--version").output().ok()?;
16− if cmd.status.success() {
17− parse_less_version(&cmd.stdout)
10+ parse_less_version(&cmd.stdout)
18− } else {
19− parse_less_version_busybox(&cmd.stderr)
20− }
21}
11}
22
12
23−fn parse_less_version(output: &[u8]) -> Option<LessVersion> {
13+fn parse_less_version(output: &[u8]) -> Option<usize> {
24 if !output.starts_with(b"less ") {
14 if !output.starts_with(b"less ") {
25 return None;
15 return None;
26 }
16 }
27
17
28 let version = std::str::from_utf8(&output[5..]).ok()?;
18 let version = std::str::from_utf8(&output[5..]).ok()?;
29 let end = version.find(|c: char| !c.is_ascii_digit())?;
19 let end = version.find(|c: char| !c.is_ascii_digit())?;
30− Some(LessVersion::Less(version[..end].parse::<usize>().ok()?))
20+ version[..end].parse::<usize>().ok()
31−}
32−
33−fn parse_less_version_busybox(output: &[u8]) -> Option<LessVersion> {
34− match std::str::from_utf8(output) {
35− Ok(version) if version.contains("BusyBox ") => Some(LessVersion::BusyBox),
36− _ => None,
37− }
38}
21}
39
22
40#[test]
23#[test]
@@ -47,7 +30,7 @@ For information about the terms of redistribution,
47see the file named README in the less distribution.
30see the file named README in the less distribution.
48Homepage: http://www.greenwoodsoftware.com/less";
31Homepage: http://www.greenwoodsoftware.com/less";
49
32
50− assert_eq!(Some(LessVersion::Less(487)), parse_less_version(output));
33+ assert_eq!(Some(487), parse_less_version(output));
51}
34}
52
35
53#[test]
36#[test]
@@ -60,7 +43,7 @@ For information about the terms of redistribution,
60see the file named README in the less distribution.
43see the file named README in the less distribution.
61Homepage: http://www.greenwoodsoftware.com/less";
44Homepage: http://www.greenwoodsoftware.com/less";
62
45
63− assert_eq!(Some(LessVersion::Less(529)), parse_less_version(output));
46+ assert_eq!(Some(529), parse_less_version(output));
64}
47}
65
48
66#[test]
49#[test]
@@ -73,7 +56,7 @@ For information about the terms of redistribution,
73see the file named README in the less distribution.
56see the file named README in the less distribution.
74Home page: http://www.greenwoodsoftware.com/less";
57Home page: http://www.greenwoodsoftware.com/less";
75
58
76− assert_eq!(Some(LessVersion::Less(551)), parse_less_version(output));
59+ assert_eq!(Some(551), parse_less_version(output));
77}
60}
78
61
79#[test]
62#[test]
@@ -86,7 +69,7 @@ For information about the terms of redistribution,
86see the file named README in the less distribution.
69see the file named README in the less distribution.
87Home page: https://greenwoodsoftware.com/less";
70Home page: https://greenwoodsoftware.com/less";
88
71
89− assert_eq!(Some(LessVersion::Less(581)), parse_less_version(output));
72+ assert_eq!(Some(581), parse_less_version(output));
90}
73}
91
74
92#[test]
75#[test]
@@ -94,38 +77,4 @@ fn test_parse_less_version_wrong_program() {
94 let output = b"more from util-linux 2.34";
77 let output = b"more from util-linux 2.34";
95
78
96 assert_eq!(None, parse_less_version(output));
79 assert_eq!(None, parse_less_version(output));
97− assert_eq!(None, parse_less_version_busybox(output));
98−}
99−
100−#[test]
101−fn test_parse_less_version_busybox() {
102− let output = b"pkg/less: unrecognized option '--version'
103−BusyBox v1.35.0 (2022-04-21 10:38:11 EDT) multi-call binary.
104−
105−Usage: less [-EFIMmNSRh~] [FILE]...
106−
107−View FILE (or stdin) one screenful at a time
108−
109− -E Quit once the end of a file is reached
110− -F Quit if entire file fits on first screen
111− -I Ignore case in all searches
112− -M,-m Display status line with line numbers
113− and percentage through the file
114− -N Prefix line number to each line
115− -S Truncate long lines
116− -R Remove color escape codes in input
117− -~ Suppress ~s displayed past EOF";
118−
119− assert_eq!(
120− Some(LessVersion::BusyBox),
121− parse_less_version_busybox(output)
122− );
123−}
124−
125−#[test]
126−fn test_parse_less_version_invalid_utf_8() {
127− let output = b"\xff";
128−
129− assert_eq!(None, parse_less_version(output));
130− assert_eq!(None, parse_less_version_busybox(output));
131}
80}
src/output.rs+5−7
@@ -4,7 +4,7 @@ use std::process::Child;
4
4
5use crate::error::*;
5use crate::error::*;
6#[cfg(feature = "paging")]
6#[cfg(feature = "paging")]
7−use crate::less::{retrieve_less_version, LessVersion};
7+use crate::less::retrieve_less_version;
8#[cfg(feature = "paging")]
8#[cfg(feature = "paging")]
9use crate::paging::PagingMode;
9use crate::paging::PagingMode;
10#[cfg(feature = "paging")]
10#[cfg(feature = "paging")]
@@ -83,13 +83,13 @@ impl OutputType {
83 let replace_arguments_to_less = pager.source == PagerSource::EnvVarPager;
83 let replace_arguments_to_less = pager.source == PagerSource::EnvVarPager;
84
84
85 if args.is_empty() || replace_arguments_to_less {
85 if args.is_empty() || replace_arguments_to_less {
86− p.arg("-R"); // Short version of --RAW-CONTROL-CHARS for maximum compatibility
86+ p.arg("--RAW-CONTROL-CHARS");
87 if single_screen_action == SingleScreenAction::Quit {
87 if single_screen_action == SingleScreenAction::Quit {
88− p.arg("-F"); // Short version of --quit-if-one-screen for compatibility
88+ p.arg("--quit-if-one-screen");
89 }
89 }
90
90
91 if wrapping_mode == WrappingMode::NoWrapping(true) {
91 if wrapping_mode == WrappingMode::NoWrapping(true) {
92− p.arg("-S"); // Short version of --chop-long-lines for compatibility
92+ p.arg("--chop-long-lines");
93 }
93 }
94
94
95 // Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
95 // Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
@@ -103,9 +103,7 @@ impl OutputType {
103 None => {
103 None => {
104 p.arg("--no-init");
104 p.arg("--no-init");
105 }
105 }
106− Some(LessVersion::Less(version))
107− if (version < 530 || (cfg!(windows) && version < 558)) =>
106+ Some(version) if (version < 530 || (cfg!(windows) && version < 558)) => {
108− {
109 p.arg("--no-init");
107 p.arg("--no-init");
110 }
108 }
111 _ => {}
109 _ => {}
src/preprocessor.rs+3−10
@@ -53,33 +53,26 @@ pub fn replace_nonprintable(input: &[u8], tab_width: usize) -> String {
53 let tab_width = if tab_width == 0 { 4 } else { tab_width };
53 let tab_width = if tab_width == 0 { 4 } else { tab_width };
54
54
55 let mut idx = 0;
55 let mut idx = 0;
56− let mut line_idx = 0;
57 let len = input.len();
56 let len = input.len();
58 while idx < len {
57 while idx < len {
59 if let Some((chr, skip_ahead)) = try_parse_utf8_char(&input[idx..]) {
58 if let Some((chr, skip_ahead)) = try_parse_utf8_char(&input[idx..]) {
60 idx += skip_ahead;
59 idx += skip_ahead;
61− line_idx += 1;
62
60
63 match chr {
61 match chr {
64 // space
62 // space
65 ' ' => output.push('·'),
63 ' ' => output.push('·'),
66 // tab
64 // tab
67 '\t' => {
65 '\t' => {
68− let tab_stop = tab_width - ((line_idx - 1) % tab_width);
66+ if tab_width == 1 {
69− line_idx = 0;
70− if tab_stop == 1 {
71 output.push('↹');
67 output.push('↹');
72 } else {
68 } else {
73 output.push('├');
69 output.push('├');
74− output.push_str(&"─".repeat(tab_stop - 2));
70+ output.push_str(&"─".repeat(tab_width - 2));
75 output.push('┤');
71 output.push('┤');
76 }
72 }
77 }
73 }
78 // line feed
74 // line feed
79− '\x0A' => {
80− output.push_str("␊\x0A");
75+ '\x0A' => output.push_str("␊\x0A"),
81− line_idx = 0;
82− }
83 // carriage return
76 // carriage return
84 '\x0D' => output.push('␍'),
77 '\x0D' => output.push('␍'),
85 // null
78 // null
src/pretty_printer.rs−6
@@ -164,12 +164,6 @@ impl<'a> PrettyPrinter<'a> {
164 self
164 self
165 }
165 }
166
166
167− /// Whether to print binary content or nonprintable characters (default: no)
168− pub fn show_nonprintable(&mut self, yes: bool) -> &mut Self {
169− self.config.show_nonprintable = yes;
170− self
171− }
172−
173 /// Whether to show "snip" markers between visible line ranges (default: no)
167 /// Whether to show "snip" markers between visible line ranges (default: no)
174 pub fn snip(&mut self, yes: bool) -> &mut Self {
168 pub fn snip(&mut self, yes: bool) -> &mut Self {
175 self.active_style_components.snip = yes;
169 self.active_style_components.snip = yes;
src/printer.rs+2−23
@@ -445,21 +445,9 @@ impl<'a> Printer for InteractivePrinter<'a> {
445 return Ok(());
445 return Ok(());
446 }
446 }
447 };
447 };
448−
449− // skip syntax highlighting on long lines
450− let too_long = line.len() > 1024 * 16;
451−
452− let for_highlighting: &str = if too_long { "\n" } else { &line };
453−
454− let mut highlighted_line = highlighter_from_set
448+ highlighter_from_set
455 .highlighter
449 .highlighter
456− .highlight_line(for_highlighting, highlighter_from_set.syntax_set)?;
450+ .highlight(&line, highlighter_from_set.syntax_set)
457−
458− if too_long {
459− highlighted_line[0].1 = &line;
460− }
461−
462− highlighted_line
463 };
451 };
464
452
465 if out_of_range {
453 if out_of_range {
@@ -475,10 +463,6 @@ impl<'a> Printer for InteractivePrinter<'a> {
475 let highlight_this_line =
463 let highlight_this_line =
476 self.config.highlighted_lines.0.check(line_number) == RangeCheckResult::InRange;
464 self.config.highlighted_lines.0.check(line_number) == RangeCheckResult::InRange;
477
465
478− if highlight_this_line && self.config.theme == "ansi" {
479− self.ansi_style.update("^[4m");
480− }
481−
482 let background_color = self
466 let background_color = self
483 .background_color_highlight
467 .background_color_highlight
484 .filter(|_| highlight_this_line);
468 .filter(|_| highlight_this_line);
@@ -665,11 +649,6 @@ impl<'a> Printer for InteractivePrinter<'a> {
665 writeln!(handle)?;
649 writeln!(handle)?;
666 }
650 }
667
651
668− if highlight_this_line && self.config.theme == "ansi" {
669− self.ansi_style.update("^[24m");
670− write!(handle, "\x1B[24m")?;
671− }
672−
673 Ok(())
652 Ok(())
674 }
653 }
675}
654}
src/style.rs+1−11
@@ -17,7 +17,6 @@ pub enum StyleComponent {
17 LineNumbers,
17 LineNumbers,
18 Snip,
18 Snip,
19 Full,
19 Full,
20− Default,
21 Plain,
20 Plain,
22}
21}
23
22
@@ -26,7 +25,7 @@ impl StyleComponent {
26 match self {
25 match self {
27 StyleComponent::Auto => {
26 StyleComponent::Auto => {
28 if interactive_terminal {
27 if interactive_terminal {
29− StyleComponent::Default.components(interactive_terminal)
28+ StyleComponent::Full.components(interactive_terminal)
30 } else {
29 } else {
31 StyleComponent::Plain.components(interactive_terminal)
30 StyleComponent::Plain.components(interactive_terminal)
32 }
31 }
@@ -49,14 +48,6 @@ impl StyleComponent {
49 StyleComponent::LineNumbers,
48 StyleComponent::LineNumbers,
50 StyleComponent::Snip,
49 StyleComponent::Snip,
51 ],
50 ],
52− StyleComponent::Default => &[
53− #[cfg(feature = "git")]
54− StyleComponent::Changes,
55− StyleComponent::Grid,
56− StyleComponent::HeaderFilename,
57− StyleComponent::LineNumbers,
58− StyleComponent::Snip,
59− ],
60 StyleComponent::Plain => &[],
51 StyleComponent::Plain => &[],
61 }
52 }
62 }
53 }
@@ -78,7 +69,6 @@ impl FromStr for StyleComponent {
78 "numbers" => Ok(StyleComponent::LineNumbers),
69 "numbers" => Ok(StyleComponent::LineNumbers),
79 "snip" => Ok(StyleComponent::Snip),
70 "snip" => Ok(StyleComponent::Snip),
80 "full" => Ok(StyleComponent::Full),
71 "full" => Ok(StyleComponent::Full),
81− "default" => Ok(StyleComponent::Default),
82 "plain" => Ok(StyleComponent::Plain),
72 "plain" => Ok(StyleComponent::Plain),
83 _ => Err(format!("Unknown style '{}'", s).into()),
73 _ => Err(format!("Unknown style '{}'", s).into()),
84 }
74 }
src/syntax_mapping.rs+2−24
@@ -41,9 +41,6 @@ impl<'a> SyntaxMapping<'a> {
41 pub fn builtin() -> SyntaxMapping<'a> {
41 pub fn builtin() -> SyntaxMapping<'a> {
42 let mut mapping = Self::empty();
42 let mut mapping = Self::empty();
43 mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap();
43 mapping.insert("*.h", MappingTarget::MapTo("C++")).unwrap();
44− mapping
45− .insert(".clang-format", MappingTarget::MapTo("YAML"))
46− .unwrap();
47 mapping.insert("*.fs", MappingTarget::MapTo("F#")).unwrap();
44 mapping.insert("*.fs", MappingTarget::MapTo("F#")).unwrap();
48 mapping
45 mapping
49 .insert("build", MappingTarget::MapToUnknown)
46 .insert("build", MappingTarget::MapToUnknown)
@@ -120,32 +117,13 @@ impl<'a> SyntaxMapping<'a> {
120 mapping.insert(glob, MappingTarget::MapTo("INI")).unwrap();
117 mapping.insert(glob, MappingTarget::MapTo("INI")).unwrap();
121 }
118 }
122
119
123− // unix mail spool
124− for glob in &["/var/spool/mail/*", "/var/mail/*"] {
125− mapping.insert(glob, MappingTarget::MapTo("Email")).unwrap()
126− }
127−
128 // pacman hooks
120 // pacman hooks
129 mapping
121 mapping
130 .insert("*.hook", MappingTarget::MapTo("INI"))
122 .insert("*.hook", MappingTarget::MapTo("INI"))
131 .unwrap();
123 .unwrap();
132
124
133− // Global git config files rooted in `$XDG_CONFIG_HOME/git/` or `$HOME/.config/git/`
134− // See e.g. https://git-scm.com/docs/git-config#FILES
135− if let Some(xdg_config_home) =
125+ if let Some(xdg_config_home) = std::env::var_os("XDG_CONFIG_HOME") {
136− std::env::var_os("XDG_CONFIG_HOME").filter(|val| !val.is_empty())
137− {
138− insert_git_config_global(&mut mapping, &xdg_config_home);
139− }
140− if let Some(default_config_home) = std::env::var_os("HOME")
141− .filter(|val| !val.is_empty())
142− .map(|home| Path::new(&home).join(".config"))
143− {
144− insert_git_config_global(&mut mapping, &default_config_home);
145− }
146−
147− fn insert_git_config_global(mapping: &mut SyntaxMapping, config_home: impl AsRef<Path>) {
148− let git_config_path = config_home.as_ref().join("git");
126+ let git_config_path = Path::new(&xdg_config_home).join("git");
149
127
150 mapping
128 mapping
151 .insert(
129 .insert(
tests/examples/git/.config/git/configdeleted−3
@@ -1,3 +0,0 @@
1−[user]
2− email = foo@bar.net
3− name = foobar
tests/examples/git/.gitconfigdeleted−3
@@ -1,3 +0,0 @@
1−[user]
2− email = foo@bar.net
3− name = foobar
tests/examples/longline.jsondeleted−3
@@ -1,3 +0,0 @@
1−{"api":
2− {"ANGLE_instanced_arrays":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"drawArraysInstancedANGLE":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"drawElementsInstancedANGLE":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"vertexAttribDivisorANGLE":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}}},"AbortController":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController","spec_url":"https://dom.spec.whatwg.org/#interface-abortcontroller","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}},"AbortController":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController/AbortController","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortcontroller-abortcontroller①","description":"<code>AbortController()</code> constructor","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}}},"abort":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController/abort","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortcontroller-abortcontroller①","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}}},"signal":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController/signal","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortcontroller-signal②","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}}}},"AbortPaymentEvent":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortPaymentEvent","support":{"chrome":{"version_added":"70"},"chrome_android":{"version_added":"70"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"57"},"opera_android":{"version_added":"49"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"10.0"},"webview_android":{"version_added":false}},"status":{"experimental":true,"standard_track":false,"deprecated":false}},"AbortPaymentEvent":{"__compat":{"description":"<code>AbortPaymentEvent()</code> constructor","mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortPaymentEvent/AbortPaymentEvent","support":{"chrome":{"version_added":"70"},"chrome_android":{"version_added":"70"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"57"},"opera_android":{"version_added":"49"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"10.0"},"webview_android":{"version_added":false}},"status":{"experimental":true,"standard_track":false,"deprecated":false}}},"respondWith":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortPaymentEvent/respondWith","support":{"chrome":{"version_added":"70"},"chrome_android":{"version_added":"70"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"57"},"opera_android":{"version_added":"49"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"10.0"},"webview_android":{"version_added":false}},"status":{"experimental":true,"standard_track":false,"deprecated":false}}}},"AbortSignal":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal","spec_url":"https://dom.spec.whatwg.org/#interface-AbortSignal","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"abort":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/abort","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortsignal-abort①","support":{"chrome":{"version_added":false},"chrome_android":{"version_added":false},"edge":{"version_added":false},"firefox":{"version_added":"88"},"firefox_android":{"version_added":"88"},"ie":{"version_added":false},"nodejs":{"version_added":false},"opera":{"version_added":false},"opera_android":{"version_added":false},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":false},"webview_android":{"version_added":false}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"abort_event":{"__compat":{"description":"<code>abort</code> event","mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event","spec_url":"https://dom.spec.whatwg.org/#eventdef-abortsignal-abort","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"aborted":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortsignal-aborted①","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"onabort":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/onabort","spec_url":"https://dom.spec.whatwg.org/#abortsignal-onabort","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}}},"AbsoluteOrientationSensor":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbsoluteOrientationSensor","spec_url":"https://w3c.github.io/orientation-sensor/#absoluteorientationsensor-interface","support":{"chrome":{"version_added":"67"},"chrome_android":{"version_added":"67"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"54"},"opera_android":{"version_added":"48"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"67"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"AbsoluteOrientationSensor":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbsoluteOrientationSensor/AbsoluteOrientationSensor","spec_url":"https://w3c.github.io/orientation-sensor/#dom-absoluteorientationsensor-absoluteorientationsensor","description":"<code>AbsoluteOrientationSensor()</code> constructor","support":{"chrome":{"version_added":"67"},"chrome_android":{"version_added":"67"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"54"},"opera_android":{"version_added":"48"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"67"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}}},"AbstractRange":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbstractRange","spec_url":"https://dom.spec.whatwg.org/#interface-abstractrange","support":{"chrome":{"version_added":"90"},"chrome_android":{"version_added":"90"},"edge":[{"version_added":"90"},{"version_added":"18","version_removed":"79"}],"firefox":{"version_added":"69"},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":false},"opera_android":{"version_added":false},"safari":{"version_added":"14.1"},"safari_ios":{"version_added":"14.5"},"samsunginternet_android":{"version_added":false},"webview_android":{"version_added":"90"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"collapsed":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbstractRange/collapsed","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-range-collapsed①","support":{"chrome":{"version_added":"90"},"chrome_android":{"version_added":"90"},"edge":[{"version_added":"90"},{"version_added":"18","version_removed":"79"}],"firefox":{"version_added":"69"},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":false},"opera_android":
3− {"version_added":false}
tests/integration_tests.rs+1−185
@@ -974,53 +974,6 @@ fn header_full_binary() {
974 .stderr("");
974 .stderr("");
975}
975}
976
976
977−#[test]
978−fn header_default() {
979− bat()
980− .arg("--paging=never")
981− .arg("--color=never")
982− .arg("--terminal-width=80")
983− .arg("--wrap=never")
984− .arg("--decorations=always")
985− .arg("--style=default")
986− .arg("single-line.txt")
987− .assert()
988− .success()
989− .stdout(
990− "\
991−───────┬────────────────────────────────────────────────────────────────────────
992− │ File: single-line.txt
993−───────┼────────────────────────────────────────────────────────────────────────
994− 1 │ Single Line
995−───────┴────────────────────────────────────────────────────────────────────────
996−",
997− )
998− .stderr("");
999−}
1000−
1001−#[test]
1002−fn header_default_is_default() {
1003− bat()
1004− .arg("--paging=never")
1005− .arg("--color=never")
1006− .arg("--terminal-width=80")
1007− .arg("--wrap=never")
1008− .arg("--decorations=always")
1009− .arg("single-line.txt")
1010− .assert()
1011− .success()
1012− .stdout(
1013− "\
1014−───────┬────────────────────────────────────────────────────────────────────────
1015− │ File: single-line.txt
1016−───────┼────────────────────────────────────────────────────────────────────────
1017− 1 │ Single Line
1018−───────┴────────────────────────────────────────────────────────────────────────
1019−",
1020− )
1021− .stderr("");
1022−}
1023−
1024#[test]
977#[test]
1025fn filename_stdin() {
978fn filename_stdin() {
1026 bat()
979 bat()
@@ -1164,9 +1117,7 @@ Single Line
1164────────────────────────────────────────────────────────────────────────────────
1117────────────────────────────────────────────────────────────────────────────────
1165",
1118",
1166 )
1119 )
1167− .stderr(
1168− "\x1b[33m[bat warning]\x1b[0m: Style 'rule' is a subset of style 'grid', 'rule' will not be visible.\n",
1120+ .stderr("\x1b[33m[bat warning]\x1b[0m: Style 'rule' is a subset of style 'grid', 'rule' will not be visible.\n");
1169− );
1170}
1121}
1171
1122
1172#[cfg(target_os = "linux")]
1123#[cfg(target_os = "linux")]
@@ -1264,52 +1215,6 @@ fn show_all_mode() {
1264 .stderr("");
1215 .stderr("");
1265}
1216}
1266
1217
1267−#[test]
1268−fn show_all_extends_tab_markers_to_next_tabstop() {
1269− bat()
1270− .arg("tabs.txt")
1271− .arg("--show-all")
1272− .arg("--tabs=4")
1273− .arg("--style=plain")
1274− .assert()
1275− .success()
1276− .stdout(
1277− "├──┤1├─┤2├─┤3├─┤4␊
1278−1├─┤?␊
1279−22├┤?␊
1280−333↹?␊
1281−4444├──┤?␊
1282−55555├─┤?␊
1283−666666├┤?␊
1284−7777777↹?␊
1285−88888888├──┤?␊
1286−",
1287− );
1288−}
1289−
1290−#[test]
1291−fn show_all_extends_tab_markers_to_next_tabstop_width_8() {
1292− bat()
1293− .arg("tabs.txt")
1294− .arg("--show-all")
1295− .arg("--tabs=8")
1296− .arg("--style=plain")
1297− .assert()
1298− .success()
1299− .stdout(
1300− "├──────┤1├─────┤2├─────┤3├─────┤4␊
1301−1├─────┤?␊
1302−22├────┤?␊
1303−333├───┤?␊
1304−4444├──┤?␊
1305−55555├─┤?␊
1306−666666├┤?␊
1307−7777777↹?␊
1308−88888888├──────┤?␊
1309−",
1310− );
1311−}
1312−
1313#[test]
1218#[test]
1314fn no_paging_arg() {
1219fn no_paging_arg() {
1315 bat()
1220 bat()
@@ -1385,25 +1290,6 @@ fn grid_for_file_without_newline() {
1385 .stderr("");
1290 .stderr("");
1386}
1291}
1387
1292
1388−// For ANSI theme, use underscore as a highlighter
1389−#[test]
1390−fn ansi_highlight_underline() {
1391− bat()
1392− .arg("--paging=never")
1393− .arg("--color=never")
1394− .arg("--terminal-width=80")
1395− .arg("--wrap=never")
1396− .arg("--decorations=always")
1397− .arg("--theme=ansi")
1398− .arg("--style=plain")
1399− .arg("--highlight-line=1")
1400− .write_stdin("Ansi Underscore Test\nAnother Line")
1401− .assert()
1402− .success()
1403− .stdout("\x1B[4mAnsi Underscore Test\n\x1B[24mAnother Line")
1404− .stderr("");
1405−}
1406−
1407// Ensure that ANSI passthrough is emitted properly for both wrapping and non-wrapping printer.
1293// Ensure that ANSI passthrough is emitted properly for both wrapping and non-wrapping printer.
1408#[test]
1294#[test]
1409fn ansi_passthrough_emit() {
1295fn ansi_passthrough_emit() {
@@ -1427,8 +1313,6 @@ fn ansi_passthrough_emit() {
1427fn ignored_suffix_arg() {
1313fn ignored_suffix_arg() {
1428 bat()
1314 bat()
1429 .arg("-f")
1315 .arg("-f")
1430− .arg("--theme")
1431− .arg("Monokai Extended")
1432 .arg("-p")
1316 .arg("-p")
1433 .arg("test.json~")
1317 .arg("test.json~")
1434 .assert()
1318 .assert()
@@ -1438,8 +1322,6 @@ fn ignored_suffix_arg() {
1438
1322
1439 bat()
1323 bat()
1440 .arg("-f")
1324 .arg("-f")
1441− .arg("--theme")
1442− .arg("Monokai Extended")
1443 .arg("-p")
1325 .arg("-p")
1444 .arg("--ignored-suffix=.suffix")
1326 .arg("--ignored-suffix=.suffix")
1445 .arg("test.json.suffix")
1327 .arg("test.json.suffix")
@@ -1450,8 +1332,6 @@ fn ignored_suffix_arg() {
1450
1332
1451 bat()
1333 bat()
1452 .arg("-f")
1334 .arg("-f")
1453− .arg("--theme")
1454− .arg("Monokai Extended")
1455 .arg("-p")
1335 .arg("-p")
1456 .arg("test.json.suffix")
1336 .arg("test.json.suffix")
1457 .assert()
1337 .assert()
@@ -1460,70 +1340,6 @@ fn ignored_suffix_arg() {
1460 .stderr("");
1340 .stderr("");
1461}
1341}
1462
1342
1463−#[test]
1464−fn highlighting_is_skipped_on_long_lines() {
1465− let expected = "\u{1b}[38;5;231m{\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;208mapi\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;231m:\u{1b}[0m\n".to_owned() +
1466− "\u{1b}" +
1467− r#"[38;5;231m {"ANGLE_instanced_arrays":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"drawArraysInstancedANGLE":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"drawElementsInstancedANGLE":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"vertexAttribDivisorANGLE":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE","spec_url":"https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/","support":{"chrome":{"version_added":"32"},"chrome_android":{"version_added":"32"},"edge":{"version_added":"12"},"firefox":{"version_added":"47"},"firefox_android":{"version_added":true},"ie":{"version_added":"11"},"opera":{"version_added":"19"},"opera_android":{"version_added":"19"},"safari":{"version_added":"8"},"safari_ios":{"version_added":"8"},"samsunginternet_android":{"version_added":"2.0"},"webview_android":{"version_added":"4.4"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}}},"AbortController":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController","spec_url":"https://dom.spec.whatwg.org/#interface-abortcontroller","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}},"AbortController":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController/AbortController","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortcontroller-abortcontroller①","description":"<code>AbortController()</code> constructor","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}}},"abort":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController/abort","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortcontroller-abortcontroller①","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}}},"signal":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortController/signal","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortcontroller-signal②","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":[{"version_added":"12.1"},{"version_added":"11.1","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"safari_ios":[{"version_added":"12.2"},{"version_added":"11.3","partial_implementation":true,"notes":"Even though <code>window.AbortController</code> is defined, it doesn't really abort <code>fetch</code> requests. See <a href='https://webkit.org/b/174980'>bug 174980</a>."}],"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":true,"standard_track":true,"deprecated":false}}}},"AbortPaymentEvent":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortPaymentEvent","support":{"chrome":{"version_added":"70"},"chrome_android":{"version_added":"70"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"57"},"opera_android":{"version_added":"49"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"10.0"},"webview_android":{"version_added":false}},"status":{"experimental":true,"standard_track":false,"deprecated":false}},"AbortPaymentEvent":{"__compat":{"description":"<code>AbortPaymentEvent()</code> constructor","mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortPaymentEvent/AbortPaymentEvent","support":{"chrome":{"version_added":"70"},"chrome_android":{"version_added":"70"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"57"},"opera_android":{"version_added":"49"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"10.0"},"webview_android":{"version_added":false}},"status":{"experimental":true,"standard_track":false,"deprecated":false}}},"respondWith":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortPaymentEvent/respondWith","support":{"chrome":{"version_added":"70"},"chrome_android":{"version_added":"70"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"57"},"opera_android":{"version_added":"49"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"10.0"},"webview_android":{"version_added":false}},"status":{"experimental":true,"standard_track":false,"deprecated":false}}}},"AbortSignal":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal","spec_url":"https://dom.spec.whatwg.org/#interface-AbortSignal","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"abort":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/abort","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortsignal-abort①","support":{"chrome":{"version_added":false},"chrome_android":{"version_added":false},"edge":{"version_added":false},"firefox":{"version_added":"88"},"firefox_android":{"version_added":"88"},"ie":{"version_added":false},"nodejs":{"version_added":false},"opera":{"version_added":false},"opera_android":{"version_added":false},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":false},"webview_android":{"version_added":false}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"abort_event":{"__compat":{"description":"<code>abort</code> event","mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event","spec_url":"https://dom.spec.whatwg.org/#eventdef-abortsignal-abort","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"aborted":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-abortsignal-aborted①","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}},"onabort":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbortSignal/onabort","spec_url":"https://dom.spec.whatwg.org/#abortsignal-onabort","support":{"chrome":{"version_added":"66"},"chrome_android":{"version_added":"66"},"edge":{"version_added":"16"},"firefox":{"version_added":"57"},"firefox_android":{"version_added":"57"},"ie":{"version_added":false},"nodejs":{"version_added":"15.0.0"},"opera":{"version_added":"53"},"opera_android":{"version_added":"47"},"safari":{"version_added":"11.1"},"safari_ios":{"version_added":"11.3"},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"66"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}}},"AbsoluteOrientationSensor":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbsoluteOrientationSensor","spec_url":"https://w3c.github.io/orientation-sensor/#absoluteorientationsensor-interface","support":{"chrome":{"version_added":"67"},"chrome_android":{"version_added":"67"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"54"},"opera_android":{"version_added":"48"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"67"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"AbsoluteOrientationSensor":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbsoluteOrientationSensor/AbsoluteOrientationSensor","spec_url":"https://w3c.github.io/orientation-sensor/#dom-absoluteorientationsensor-absoluteorientationsensor","description":"<code>AbsoluteOrientationSensor()</code> constructor","support":{"chrome":{"version_added":"67"},"chrome_android":{"version_added":"67"},"edge":{"version_added":"79"},"firefox":{"version_added":false},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":"54"},"opera_android":{"version_added":"48"},"safari":{"version_added":false},"safari_ios":{"version_added":false},"samsunginternet_android":{"version_added":"9.0"},"webview_android":{"version_added":"67"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}}}},"AbstractRange":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbstractRange","spec_url":"https://dom.spec.whatwg.org/#interface-abstractrange","support":{"chrome":{"version_added":"90"},"chrome_android":{"version_added":"90"},"edge":[{"version_added":"90"},{"version_added":"18","version_removed":"79"}],"firefox":{"version_added":"69"},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":false},"opera_android":{"version_added":false},"safari":{"version_added":"14.1"},"safari_ios":{"version_added":"14.5"},"samsunginternet_android":{"version_added":false},"webview_android":{"version_added":"90"}},"status":{"experimental":false,"standard_track":true,"deprecated":false}},"collapsed":{"__compat":{"mdn_url":"https://developer.mozilla.org/docs/Web/API/AbstractRange/collapsed","spec_url":"https://dom.spec.whatwg.org/#ref-for-dom-range-collapsed①","support":{"chrome":{"version_added":"90"},"chrome_android":{"version_added":"90"},"edge":[{"version_added":"90"},{"version_added":"18","version_removed":"79"}],"firefox":{"version_added":"69"},"firefox_android":{"version_added":false},"ie":{"version_added":false},"opera":{"version_added":false},"opera_android":"# +
1468− "\u{1b}[0m\n\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;231m{\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;208mversion_added\u{1b}[0m\u{1b}[38;5;208m\"\u{1b}[0m\u{1b}[38;5;231m:\u{1b}[0m\u{1b}[38;5;141mfalse\u{1b}[0m\u{1b}[38;5;231m}\u{1b}[0m\n";
1469−
1470− bat()
1471− .arg("-f")
1472− .arg("--theme")
1473− .arg("Monokai Extended")
1474− .arg("-p")
1475− .arg("longline.json")
1476− .assert()
1477− .success()
1478− .stdout(expected)
1479− .stderr("");
1480−}
1481−
1482−#[test]
1483−fn all_global_git_config_locations_syntax_mapping_work() {
1484− let fake_home = Path::new(EXAMPLES_DIR).join("git").canonicalize().unwrap();
1485− let expected = "\u{1b}[38;5;231m[\u{1b}[0m\u{1b}[38;5;149muser\u{1b}[0m\u{1b}[38;5;231m]\u{1b}[0m
1486−\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;231memail\u{1b}[0m\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;203m=\u{1b}[0m\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;186mfoo@bar.net\u{1b}[0m
1487−\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;231mname\u{1b}[0m\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;203m=\u{1b}[0m\u{1b}[38;5;231m \u{1b}[0m\u{1b}[38;5;186mfoobar\u{1b}[0m
1488−";
1489−
1490− bat()
1491− .env("XDG_CONFIG_HOME", fake_home.join(".config").as_os_str())
1492− .arg("-f")
1493− .arg("--theme")
1494− .arg("Monokai Extended")
1495− .arg("-p")
1496− .arg("git/.config/git/config")
1497− .assert()
1498− .success()
1499− .stdout(expected)
1500− .stderr("");
1501−
1502− bat()
1503− .env("HOME", fake_home.as_os_str())
1504− .arg("-f")
1505− .arg("--theme")
1506− .arg("Monokai Extended")
1507− .arg("-p")
1508− .arg("git/.config/git/config")
1509− .assert()
1510− .success()
1511− .stdout(expected)
1512− .stderr("");
1513−
1514− bat()
1515− .env("HOME", fake_home.as_os_str())
1516− .arg("-f")
1517− .arg("--theme")
1518− .arg("Monokai Extended")
1519− .arg("-p")
1520− .arg("git/.gitconfig")
1521− .assert()
1522− .success()
1523− .stdout(expected)
1524− .stderr("");
1525−}
1526−
1527#[test]
1343#[test]
1528fn acknowledgements() {
1344fn acknowledgements() {
1529 bat()
1345 bat()
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/highlighted/JQ/sample.jqdeleted−60
@@ -1,60 +0,0 @@
1−import "../imported-file" ;
2−
3−# With Comments !
4−def weird($a; $b; $c):
5− [ $a, $b, $c ] | transpose | reduce .[][] as $item (
6− [];
7− . + $item.property
8− )
9−;
10−
11−. | weird (.a; .b; .c) |
12−
13−(
14−
15−if (. | contains("never") ) then
16− "Why yes"
17−else
18− 12.23
19−end
20−
21−) as $never |
22−
23−{
24− hello,
25− why: "because",
26− hello: ( weird | ascii_upcase ),
27− format_eg: ( . | @json "My json string \( . | this | part | just | white | ascii_upcase | transpose)" ),
28− never: $never,
29− "literal_key": literal_value,
30− "this": 12.1e12,
31− "part": "almost"
32− "like": [
33− 12,
34− 2
35− "json"
36− {
37− "quite": {
38− similar: "but not quite"
39− }
40− }
41− ],
42−} | (
43− 
44− # And with very basic brace matching
45− 
46− # Invalid End
47− ] 
48− 
49− # Other invalid ends
50− ( [ } ] )
51−
52− # A "valid" sequence
53− ( [ { key: () , other_key:( [ [] [[]] ] ), gaga } ] )
54−
55− # A "invalid" sequence
56− ( [ { key: () , other_key:( [ [] [[] ] ), gaga } ] )
57−
58− "A string\n whith escaped characters \" because we can"
59−)
60−
tests/syntax-tests/highlighted/Log/example.log−1
@@ -1,3 +1,2 @@
12021-03-06 23:22:21.392 https://[2001:db8:4006:812::200e]:8080/path/the%20page.html
12021-03-06 23:22:21.392 https://[2001:db8:4006:812::200e]:8080/path/the%20page.html
22021-03-06 23:22:21 https://example.com:8080/path/the%20page(with_parens).html
22021-03-06 23:22:21 https://example.com:8080/path/the%20page(with_parens).html
3−2022-03-16T17:41:02.519 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Error, message: "rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `\"cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/zeta/dev/raytracer/Cargo.toml\" \"--filter-platform\" \"wasm32-unknown-unknown\"`: `cargo metadata` exited with an error: Updating crates.io index\nerror: failed to select a version for `parking_lot`.\n ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`\nversions that meet the requirements `^0.12.0` are: 0.12.0\n\nthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.\n\n\nfailed to select a version for `parking_lot` which could resolve this conflict\n" }
tests/syntax-tests/highlighted/Svelte/App.svelte+1−5
@@ -27,13 +27,9 @@
27</script>
27</script>
28
28
29<script type="text/livescript">
29<script type="text/livescript">
30− // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
30+ // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
31</script>
31</script>
32
32
33−<style lang="text/postcss">
34− /* This block is a regression test for a bat panic when a PostCSS syntax definition is missing */
35−</style>
36−
37<style>
33<style>
38 main {
34 main {
39 position: relative;
35 position: relative;
tests/syntax-tests/highlighted/Syslog/example.syslog+3−3
@@ -1,7 +1,7 @@
1Apr 4 00:00:01 hostname-here systemd[1]: logrotate.service: Succeeded.
1Apr 4 00:00:01 hostname-here systemd[1]: logrotate.service: Succeeded.
2Apr 4 00:00:01 hostname-here systemd[1]: Finished Rotate log files.
2Apr 4 00:00:01 hostname-here systemd[1]: Finished Rotate log files.
3Apr 4 00:00:01 hostname-here colord[920]: failed to get session [pid 137485]: No data available
3Apr 4 00:00:01 hostname-here colord[920]: failed to get session [pid 137485]: No data available
4−Apr 4 00:00:21 hostname-here kernel: [55604.908232] audit: type=1400 audit(1617483621.094:28): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=59311 comm="cups-browsed" capability=23 capname="sys_nice"
4+Apr 4 00:00:21 hostname-here kernel: [55604.908232] audit: type=1400 audit(1617483621.094:28): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=59311 comm="cups-browsed" capability=23 capname="sys_nice"
5Apr 4 00:01:38 hostname-here systemd-resolved[721]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
5Apr 4 00:01:38 hostname-here systemd-resolved[721]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
6Apr 4 00:04:46 hostname-here ntpd[952]: Soliciting pool server 255.76.59.37
6Apr 4 00:04:46 hostname-here ntpd[952]: Soliciting pool server 255.76.59.37
7Apr 4 00:05:21 hostname-here ntpd[952]: ::1 local addr 0:0:0:0:0:0:0:1 -> <null>
7Apr 4 00:05:21 hostname-here ntpd[952]: ::1 local addr 0:0:0:0:0:0:0:1 -> <null>
@@ -10,7 +10,7 @@
10Apr 4 16:32:07 hostname-here NetworkManager[740]: <info> [1617629527.1101] manager: NetworkManager state is now CONNECTED_GLOBAL
10Apr 4 16:32:07 hostname-here NetworkManager[740]: <info> [1617629527.1101] manager: NetworkManager state is now CONNECTED_GLOBAL
11Apr 4 22:00:45 hostname-here dbus-daemon[1094]: [session uid=1000 pid=1094] Successfully activated service 'io.github.celluloid_player.Celluloid'
11Apr 4 22:00:45 hostname-here dbus-daemon[1094]: [session uid=1000 pid=1094] Successfully activated service 'io.github.celluloid_player.Celluloid'
12Aug 11 13:29:06 hostname-here insomnia_insomnia.desktop[142666]: 13:29:06.316 › [updater] Updater not running platform=linux dev=false
12Aug 11 13:29:06 hostname-here insomnia_insomnia.desktop[142666]: 13:29:06.316 › [updater] Updater not running platform=linux dev=false
13−Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epoll add event: fd:6 op:1 ev:00002001
13+Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epoll add event: fd:6 op:1 ev:00002001
14−Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001
14+Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001
15Aug 11 21:40:31 hostname-here scop hello
15Aug 11 21:40:31 hostname-here scop hello
16Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories.
16Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories.
tests/syntax-tests/highlighted/Vue/example.vue−5
@@ -8,11 +8,6 @@
8 </div>
8 </div>
9</template>
9</template>
10
10
11−<template lang='pug'>
12− #container.col
13− p This shall be formatted as Plain Text as long as a Pug syntax definition is missing
14−</template>
15−
16<script>
11<script>
17import AppHeader from "@/components/AppHeader";
12import AppHeader from "@/components/AppHeader";
18import AppLoadingIndicator from "@/components/AppLoadingIndicator";
13import AppLoadingIndicator from "@/components/AppLoadingIndicator";
tests/syntax-tests/highlighted/Zig/example.zig+39−39
@@ -1,18 +1,18 @@
1//! this is a top level doc, starts with "//!"
1//! this is a top level doc, starts with "//!"
2
2
3−const std = @import("std");
3+const std = @import("std");
4
4
5pub fn main() anyerror!void {
5pub fn main() anyerror!void {
6− const stdout = std.io.getStdOut().writer();
6+ const stdout = std.io.getStdOut().writer();
7− try stdout.print("Hello, {}!\n", .{"world"});
7+ try stdout.print("Hello, {}!\n", .{"world"});
8}
8}
9
9
10−const expect = std.testing.expect;
10+const expect = std.testing.expect;
11
11
12test "comments" {
12test "comments" {
13 // comments start with "//" until newline
13 // comments start with "//" until newline
14 // foo bar baz
14 // foo bar baz
15− const x = true; // another comment
15+ const x = true; // another comment
16 expect(x);
16 expect(x);
17}
17}
18
18
@@ -25,26 +25,26 @@
25 /// number of nanoseconds past the second
25 /// number of nanoseconds past the second
26 nano: u32,
26 nano: u32,
27
27
28− const Self = @This();
28+ const Self = @This();
29
29
30 pub fn unixEpoch() Self {
30 pub fn unixEpoch() Self {
31 return Self{
31 return Self{
32− .seconds = 0,
32+ .seconds = 0,
33− .nanos = 0,
33+ .nanos = 0,
34 };
34 };
35 }
35 }
36};
36};
37
37
38−const my_val = switch (std.Target.current.os.tag) {
38+const my_val = switch (std.Target.current.os.tag) {
39− .linux => "Linux",
39+ .linux => "Linux",
40 else => "not Linux",
40 else => "not Linux",
41};
41};
42
42
43const Book = enum {
43const Book = enum {
44− paperback,
44+ paperback,
45− hardcover,
45+ hardcover,
46− ebook,
46+ ebook,
47− pdf,
47+ pdf,
48};
48};
49
49
50const TokenType = union(enum) {
50const TokenType = union(enum) {
@@ -54,54 +54,54 @@
54};
54};
55
55
56const array_lit: [4]u8 = .{ 11, 22, 33, 44 };
56const array_lit: [4]u8 = .{ 11, 22, 33, 44 };
57−const sentinal_lit = [_:0]u8{ 1, 2, 3, 4 };
57+const sentinal_lit = [_:0]u8{ 1, 2, 3, 4 };
58
58
59test "address of syntax" {
59test "address of syntax" {
60 // Get the address of a variable:
60 // Get the address of a variable:
61 const x: i32 = 1234;
61 const x: i32 = 1234;
62− const x_ptr = &x;
62+ const x_ptr = &x;
63
63
64 // Dereference a pointer:
64 // Dereference a pointer:
65 expect(x_ptr.* == 1234);
65 expect(x_ptr.* == 1234);
66
66
67 // When you get the address of a const variable, you get a const pointer to a single item.
67 // When you get the address of a const variable, you get a const pointer to a single item.
68− expect(@TypeOf(x_ptr) == *const i32);
68+ expect(@TypeOf(x_ptr) == *const i32);
69
69
70 // If you want to mutate the value, you'd need an address of a mutable variable:
70 // If you want to mutate the value, you'd need an address of a mutable variable:
71 var y: i32 = 5678;
71 var y: i32 = 5678;
72− const y_ptr = &y;
72+ const y_ptr = &y;
73− expect(@TypeOf(y_ptr) == *i32);
73+ expect(@TypeOf(y_ptr) == *i32);
74− y_ptr.* += 1;
74+ y_ptr.* += 1;
75 expect(y_ptr.* == 5679);
75 expect(y_ptr.* == 5679);
76}
76}
77
77
78// integer literals
78// integer literals
79−const decimal_int = 98222;
79+const decimal_int = 98222;
80−const hex_int = 0xff;
80+const hex_int = 0xff;
81−const another_hex_int = 0xFF;
81+const another_hex_int = 0xFF;
82−const octal_int = 0o755;
82+const octal_int = 0o755;
83−const binary_int = 0b11110000;
83+const binary_int = 0b11110000;
84
84
85// underscores may be placed between two digits as a visual separator
85// underscores may be placed between two digits as a visual separator
86−const one_billion = 1_000_000_000;
86+const one_billion = 1_000_000_000;
87−const binary_mask = 0b1_1111_1111;
87+const binary_mask = 0b1_1111_1111;
88−const permissions = 0o7_5_5;
88+const permissions = 0o7_5_5;
89−const big_address = 0xFF80_0000_0000_0000;
89+const big_address = 0xFF80_0000_0000_0000;
90
90
91// float literals
91// float literals
92−const floating_point = 123.0E+77;
92+const floating_point = 123.0E+77;
93−const another_float = 123.0;
93+const another_float = 123.0;
94−const yet_another = 123.0e+77;
94+const yet_another = 123.0e+77;
95
95
96−const hex_floating_point = 0x103.70p-5;
96+const hex_floating_point = 0x103.70p-5;
97−const another_hex_float = 0x103.70;
97+const another_hex_float = 0x103.70;
98−const yet_another_hex_float = 0x103.70P-5;
98+const yet_another_hex_float = 0x103.70P-5;
99
99
100// underscores may be placed between two digits as a visual separator
100// underscores may be placed between two digits as a visual separator
101−const lightspeed = 299_792_458.000_000;
101+const lightspeed = 299_792_458.000_000;
102−const nanosecond = 0.000_000_001;
102+const nanosecond = 0.000_000_001;
103−const more_hex = 0x1234_5678.9ABC_CDEFp-10;
103+const more_hex = 0x1234_5678.9ABC_CDEFp-10;
104
104
105fn max(comptime T: type, a: T, b: T) T {
105fn max(comptime T: type, a: T, b: T) T {
106− return if (a > b) a else b;
106+ return if (a > b) a else b;
107}
107}
tests/syntax-tests/highlighted/cmd-help/test.cmd-helpdeleted−54
@@ -1,54 +0,0 @@
1−bat 0.20.0 (e735562-modified)
2−A cat(1) clone with syntax highlighting and Git integration.
3−
4−USAGE:
5− bat [OPTIONS] [FILE]...
6− bat <SUBCOMMAND>
7−
8−OPTIONS:
9− -A, --show-all
10− Show non-printable characters (space, tab, newline, ..).
11−
12− -p, --plain Show plain style (alias for '--style=plain').
13− -l, --language <language> Set the language for syntax highlighting.
14− -H, --highlight-line <N:M>... Highlight lines N through M.
15− --file-name <name>... Specify the name to display for a file.
16− -d, --diff
17− Only show lines that have been added/removed/modified.
18−
19− --tabs <T> Set the tab width to T spaces.
20− --wrap <mode>
21− Specify the text-wrapping mode (*auto*, never, character).
22−
23− -n, --number
24− Show line numbers (alias for '--style=numbers').
25−
26− --color <when> When to use colors (*auto*, never, always).
27− --italic-text <when> Use italics in output (always, *never*)
28− --decorations <when>
29− When to show the decorations (*auto*, never, always).
30−
31− --paging <when>
32− Specify when to use the pager, or use `-P` to disable (*auto*, never,
33− always).
34− -m, --map-syntax <glob:syntax>...
35− Use the specified syntax for files matching the glob pattern
36− ('*.cpp:C++').
37− --theme <theme> Set the color theme for syntax highlighting.
38− --list-themes Display all supported highlighting themes.
39− --style <components>
40− Comma-separated list of style elements to display (*auto*, full, plain,
41− changes, header, grid, rule, numbers, snip).
42− -r, --line-range <N:M>... Only print the lines from N to M.
43− -L, --list-languages Display all supported languages.
44− -h, --help Print this help message.
45− -V, --version Show version information.
46−
47−ARGS:
48− <FILE>... File(s) to print / concatenate. Use '-' for standard input.
49−
50−SUBCOMMANDS:
51− cache Modify the syntax-definition and theme cache
52−
53−Note: `bat -h` prints a short and concise overview while `bat --help` gives all
54−details.
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
tests/syntax-tests/source/JQ/LICENSE.mddeleted−25
@@ -1,25 +0,0 @@
1−The `sample.jq` file was taken from [SublimeJQ] under the following license:
2−
3−[SublimeJQ]: https://github.com/zogwarg/SublimeJQ
4−
5−MIT License
6−
7−Copyright (c) 2017 Thomas Buick
8−
9−Permission is hereby granted, free of charge, to any person obtaining a copy
10−of this software and associated documentation files (the "Software"), to deal
11−in the Software without restriction, including without limitation the rights
12−to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13−copies of the Software, and to permit persons to whom the Software is
14−furnished to do so, subject to the following conditions:
15−
16−The above copyright notice and this permission notice shall be included in all
17−copies or substantial portions of the Software.
18−
19−THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20−IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21−FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22−AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23−LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24−OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25−SOFTWARE.
tests/syntax-tests/source/JQ/sample.jqdeleted−60
@@ -1,60 +0,0 @@
1−import "../imported-file" ;
2−
3−# With Comments !
4−def weird($a; $b; $c):
5− [ $a, $b, $c ] | transpose | reduce .[][] as $item (
6− [];
7− . + $item.property
8− )
9−;
10−
11−. | weird (.a; .b; .c) |
12−
13−(
14−
15−if (. | contains("never") ) then
16− "Why yes"
17−else
18− 12.23
19−end
20−
21−) as $never |
22−
23−{
24− hello,
25− why: "because",
26− hello: ( weird | ascii_upcase ),
27− format_eg: ( . | @json "My json string \( . | this | part | just | white | ascii_upcase | transpose)" ),
28− never: $never,
29− "literal_key": literal_value,
30− "this": 12.1e12,
31− "part": "almost"
32− "like": [
33− 12,
34− 2
35− "json"
36− {
37− "quite": {
38− similar: "but not quite"
39− }
40− }
41− ],
42−} | (
43−
44− # And with very basic brace matching
45−
46− # Invalid End
47− ]
48−
49− # Other invalid ends
50− ( [ } ] )
51−
52− # A "valid" sequence
53− ( [ { key: () , other_key:( [ [] [[]] ] ), gaga } ] )
54−
55− # A "invalid" sequence
56− ( [ { key: () , other_key:( [ [] [[] ] ), gaga } ] )
57−
58− "A string\n whith escaped characters \" because we can"
59−)
60−
tests/syntax-tests/source/Log/example.log−1
@@ -1,3 +1,2 @@
12021-03-06 23:22:21.392 https://[2001:db8:4006:812::200e]:8080/path/the%20page.html
12021-03-06 23:22:21.392 https://[2001:db8:4006:812::200e]:8080/path/the%20page.html
22021-03-06 23:22:21 https://example.com:8080/path/the%20page(with_parens).html
22021-03-06 23:22:21 https://example.com:8080/path/the%20page(with_parens).html
3−2022-03-16T17:41:02.519 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Error, message: "rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `\"cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/zeta/dev/raytracer/Cargo.toml\" \"--filter-platform\" \"wasm32-unknown-unknown\"`: `cargo metadata` exited with an error: Updating crates.io index\nerror: failed to select a version for `parking_lot`.\n ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`\nversions that meet the requirements `^0.12.0` are: 0.12.0\n\nthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.\n\n\nfailed to select a version for `parking_lot` which could resolve this conflict\n" }
tests/syntax-tests/source/Svelte/App.svelte+1−5
@@ -27,13 +27,9 @@
27</script>
27</script>
28
28
29<script type="text/livescript">
29<script type="text/livescript">
30− // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
30+ // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
31</script>
31</script>
32
32
33−<style lang="text/postcss">
34− /* This block is a regression test for a bat panic when a PostCSS syntax definition is missing */
35−</style>
36−
37<style>
33<style>
38 main {
34 main {
39 position: relative;
35 position: relative;
tests/syntax-tests/source/Vue/example.vue−5
@@ -8,11 +8,6 @@
8 </div>
8 </div>
9</template>
9</template>
10
10
11−<template lang='pug'>
12− #container.col
13− p This shall be formatted as Plain Text as long as a Pug syntax definition is missing
14−</template>
15−
16<script>
11<script>
17import AppHeader from "@/components/AppHeader";
12import AppHeader from "@/components/AppHeader";
18import AppLoadingIndicator from "@/components/AppLoadingIndicator";
13import AppLoadingIndicator from "@/components/AppLoadingIndicator";
tests/syntax-tests/source/cmd-help/test.cmd-helpdeleted−54
@@ -1,54 +0,0 @@
1−bat 0.20.0 (e735562-modified)
2−A cat(1) clone with syntax highlighting and Git integration.
3−
4−USAGE:
5− bat [OPTIONS] [FILE]...
6− bat <SUBCOMMAND>
7−
8−OPTIONS:
9− -A, --show-all
10− Show non-printable characters (space, tab, newline, ..).
11−
12− -p, --plain Show plain style (alias for '--style=plain').
13− -l, --language <language> Set the language for syntax highlighting.
14− -H, --highlight-line <N:M>... Highlight lines N through M.
15− --file-name <name>... Specify the name to display for a file.
16− -d, --diff
17− Only show lines that have been added/removed/modified.
18−
19− --tabs <T> Set the tab width to T spaces.
20− --wrap <mode>
21− Specify the text-wrapping mode (*auto*, never, character).
22−
23− -n, --number
24− Show line numbers (alias for '--style=numbers').
25−
26− --color <when> When to use colors (*auto*, never, always).
27− --italic-text <when> Use italics in output (always, *never*)
28− --decorations <when>
29− When to show the decorations (*auto*, never, always).
30−
31− --paging <when>
32− Specify when to use the pager, or use `-P` to disable (*auto*, never,
33− always).
34− -m, --map-syntax <glob:syntax>...
35− Use the specified syntax for files matching the glob pattern
36− ('*.cpp:C++').
37− --theme <theme> Set the color theme for syntax highlighting.
38− --list-themes Display all supported highlighting themes.
39− --style <components>
40− Comma-separated list of style elements to display (*auto*, full, plain,
41− changes, header, grid, rule, numbers, snip).
42− -r, --line-range <N:M>... Only print the lines from N to M.
43− -L, --list-languages Display all supported languages.
44− -h, --help Print this help message.
45− -V, --version Show version information.
46−
47−ARGS:
48− <FILE>... File(s) to print / concatenate. Use '-' for standard input.
49−
50−SUBCOMMANDS:
51− cache Modify the syntax-definition and theme cache
52−
53−Note: `bat -h` prints a short and concise overview while `bat --help` gives all
54−details.