From 530e83a45506a4792e788944a75a2e89b82518ab Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sat, 16 May 2026 13:51:00 -0700 Subject: [PATCH 01/20] feat: bat auto-detects language from stdin via first-line patterns When piped input has no filename hint, bat falls back to plain text. Many common formats can be reliably identified by shebang or magic-string in the first line (#!/bin/bash, Result>> { let syntax_set = self.get_syntax_set()?; - Ok(String::from_utf8(reader.first_line.clone()) + Ok(std::str::from_utf8(&reader.first_line) .ok() .and_then(|l| { // Strip UTF-8 BOM if present - let line = l.strip_prefix('\u{feff}').unwrap_or(&l); + let line = l.strip_prefix('\u{feff}').unwrap_or(l); syntax_set.find_syntax_by_first_line(line) }) .map(|syntax| SyntaxReferenceInSet { syntax, syntax_set })) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index cfbad253..9c7cc285 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -2470,6 +2470,145 @@ fn no_first_line_fallback_when_mapping_to_invalid_syntax() { .stderr(predicate::str::contains("unknown syntax: 'InvalidSyntax'")); } +#[test] +fn stdin_detects_bash_from_first_line() { + let content = "#!/bin/bash\necho hi\n"; + + let detected_output = bat() + .arg("--color=always") + .arg("--style=plain") + .write_stdin(content) + .assert() + .success() + .get_output() + .stdout + .clone(); + + let explicit_output = bat() + .arg("--color=always") + .arg("--style=plain") + .arg("--language=bash") + .write_stdin(content) + .assert() + .success() + .get_output() + .stdout + .clone(); + + assert_eq!( + from_utf8(&detected_output).expect("output is valid utf-8"), + from_utf8(&explicit_output).expect("output is valid utf-8") + ); +} + +#[test] +fn stdin_detects_diff_from_first_line() { + let content = "diff --git a/x b/y\n--- a/x\n+++ b/y\n@@ -1 +1 @@\n-old\n+new\n"; + + let detected_output = bat() + .arg("--color=always") + .arg("--style=plain") + .write_stdin(content) + .assert() + .success() + .get_output() + .stdout + .clone(); + + let explicit_output = bat() + .arg("--color=always") + .arg("--style=plain") + .arg("--language=diff") + .write_stdin(content) + .assert() + .success() + .get_output() + .stdout + .clone(); + + assert_eq!( + from_utf8(&detected_output).expect("output is valid utf-8"), + from_utf8(&explicit_output).expect("output is valid utf-8") + ); +} + +#[test] +fn empty_stdin_does_not_detect_syntax() { + bat() + .arg("--color=always") + .arg("--style=plain") + .write_stdin("") + .assert() + .success() + .stdout("") + .stderr(""); +} + +#[test] +fn binary_stdin_does_not_detect_syntax_from_invalid_utf8_first_line() { + let content = b"#!/bin/bash\xff\necho hi\n"; + + let detected_output = bat() + .arg("--binary=as-text") + .arg("--color=always") + .arg("--style=plain") + .write_stdin(content.as_slice()) + .assert() + .success() + .get_output() + .stdout + .clone(); + + let plain_text_output = bat() + .arg("--binary=as-text") + .arg("--color=always") + .arg("--style=plain") + .arg("--language=txt") + .write_stdin(content.as_slice()) + .assert() + .success() + .get_output() + .stdout + .clone(); + + assert_eq!( + from_utf8(&detected_output).expect("output is valid utf-8"), + from_utf8(&plain_text_output).expect("output is valid utf-8") + ); +} + +#[test] +fn explicit_language_overrides_stdin_first_line_detection() { + let content = "diff --git a/x b/y\n--- a/x\n+++ b/y\n@@ -1 +1 @@\n-old\n+new\n"; + + let detected_output = bat() + .arg("--color=always") + .arg("--style=plain") + .write_stdin(content) + .assert() + .success() + .get_output() + .stdout + .clone(); + + let explicit_output = bat() + .arg("--color=always") + .arg("--style=plain") + .arg("--language=json") + .arg("-") + .write_stdin(content) + .assert() + .success() + .get_output() + .stdout + .clone(); + + assert_ne!( + from_utf8(&detected_output).expect("output is valid utf-8"), + from_utf8(&explicit_output).expect("output is valid utf-8") + ); +} + #[test] fn fallback_syntax_is_used_when_no_syntax_is_detected() { let content = "# comment\nfoo=bar\n"; From 218afc30ac960fa33ac6f5e50ced4fe9e0e085e1 Mon Sep 17 00:00:00 2001 From: cyphercodes Date: Sat, 4 Jul 2026 06:29:43 +0300 Subject: [PATCH 02/20] Respect paging mode for list languages --- CHANGELOG.md | 1 + src/bin/bat/main.rs | 8 +++----- tests/integration_tests.rs | 16 +++++++++++----- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e2fc216..a55e31c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Syntax highlighting for Python files using uv as script runner in shebang #3689 (@janlarres) ## Bugfixes +- Fix `--list-languages` respecting `--paging=never`, see #3828 (@cyphercodes) - `--strip-ansi`: also strip 8-bit C1 introducers (U+0090, U+0098, U+009B, U+009D, U+009E, U+009F) and DCS/SOS/PM/APC sequence bodies, which previously passed through. See #3729 (@curious-rabbit) - Fix `--ignored-suffix` not falling back to first-line/shebang detection when the ignored suffix is also a registered extension (e.g. `--ignored-suffix .txt` on a shebang script), see #2745 and #3816 (@adnrivera) - Fix `capacity overflow` panic when printing a snip separator at `--terminal-width=1` with multiple line ranges. Closes #3803, see #3804 (@leeewee) diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index c8bbd368..705a28b9 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -427,11 +427,9 @@ fn run() -> Result { if app.matches.get_flag("list-languages") { let languages: String = get_languages(&config, cache_dir)?; let inputs: Vec = vec![Input::from_reader(Box::new(languages.as_bytes()))]; - let plain_config = Config { - style_components: StyleComponents::new(StyleComponent::Plain.components(false)), - paging_mode: PagingMode::QuitIfOneScreen, - ..Default::default() - }; + let mut plain_config = config.clone(); + plain_config.style_components = + StyleComponents::new(StyleComponent::Plain.components(false)); run_controller(inputs, &plain_config, cache_dir) } else if app.matches.get_flag("list-themes") { list_themes(&config, config_dir, cache_dir, app.theme_options())?; diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 33de3fbf..124a9e5b 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -626,12 +626,18 @@ fn list_themes_to_piped_output() { } #[test] +#[serial] fn list_languages() { - bat() - .arg("--list-languages") - .assert() - .success() - .stdout(predicate::str::contains("Rust").normalize()); + mocked_pagers::with_mocked_versions_of_more_and_most_in_path(|| { + bat() + .env("PAGER", mocked_pagers::from("echo pager-output")) + .arg("--list-languages") + .arg("--paging=never") + .assert() + .success() + .stdout(predicate::str::contains("Rust").normalize()) + .stdout(predicate::str::contains("pager-output").not()); + }); } #[test] From d449ce5b7e77a11e50c9bf3e244bce9b87353396 Mon Sep 17 00:00:00 2001 From: Tyce Herrman Date: Wed, 29 Jul 2026 11:30:15 -0400 Subject: [PATCH 03/20] chore(deps): resolve current cargo audit failures --- CHANGELOG.md | 1 + Cargo.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e2fc216..d96a4adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Other +- Update Cargo dependencies to resolve current RustSec advisories, see #3861 (@TyceHerrman) - Add instructions for removing fish help abbreviations to README, see #3655 (@claw-explorer). Closes #3536 - Add .NET slnx extension, see #3682 (@ltrzesniewski) diff --git a/Cargo.lock b/Cargo.lock index a8cbedf8..4de6d556 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,9 +84,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "arc-swap" @@ -420,9 +420,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" dependencies = [ "crossbeam-utils", ] @@ -1178,7 +1178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b305d85504de270ad3525d726a6b69cc59ee7b2269b014387651107ab9f0755b" dependencies = [ "bstr", - "hashbrown 0.17.1", + "hashbrown 0.15.5", ] [[package]] @@ -2016,9 +2016,9 @@ checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "plist" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092791278e026273c1b65bbdcfbba3a300f2994c896bd01ab01da613c29c46f1" +checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85" dependencies = [ "base64", "indexmap", @@ -2130,9 +2130,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.39.4" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdcc8dd4e2f670d309a5f0e83fe36dfdc05af317008fea29144da1a2ac858e5e" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" dependencies = [ "memchr", ] From be5343c742f36f6a90c5438dadff52c9770d8825 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:21:51 +0000 Subject: [PATCH 04/20] build(deps): bump unicode-segmentation from 1.13.2 to 1.13.3 Bumps [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) from 1.13.2 to 1.13.3. - [Commits](https://github.com/unicode-rs/unicode-segmentation/commits) --- updated-dependencies: - dependency-name: unicode-segmentation dependency-version: 1.13.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4de6d556..b2f64ed2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1178,7 +1178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b305d85504de270ad3525d726a6b69cc59ee7b2269b014387651107ab9f0755b" dependencies = [ "bstr", - "hashbrown 0.15.5", + "hashbrown 0.17.1", ] [[package]] @@ -2744,9 +2744,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.13.2" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-width" From a9b67b2d999197df4ffa3a02ad1bc209428116e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 18:54:55 +0000 Subject: [PATCH 05/20] build(deps): bump bytesize from 2.3.1 to 2.4.2 Bumps [bytesize](https://github.com/bytesize-rs/bytesize) from 2.3.1 to 2.4.2. - [Release notes](https://github.com/bytesize-rs/bytesize/releases) - [Changelog](https://github.com/bytesize-rs/bytesize/blob/master/CHANGELOG.md) - [Commits](https://github.com/bytesize-rs/bytesize/compare/bytesize-v2.3.1...bytesize-v2.4.2) --- updated-dependencies: - dependency-name: bytesize dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2f64ed2..28e7a86a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,9 +266,9 @@ checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "bytesize" -version = "2.3.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd91ee7b2422bcb158d90ef4d14f75ef67f340943fc4149891dcce8f8b972a3" +checksum = "3d7c8918969267b2932ffd5655509bbbea0833823058c378876953217f5fc50e" [[package]] name = "cc" From bfa6e59978f886df8d886fb05527021eb0e339ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 19:17:50 +0000 Subject: [PATCH 06/20] build(deps): bump quote from 1.0.45 to 1.0.47 Bumps [quote](https://github.com/dtolnay/quote) from 1.0.45 to 1.0.47. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.45...1.0.47) --- updated-dependencies: - dependency-name: quote dependency-version: 1.0.46 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28e7a86a..e97ddf92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2139,9 +2139,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.45" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] From 839f2300b7c155edec26dc6456df89ea61e71e17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 19:46:45 +0000 Subject: [PATCH 07/20] build(deps): bump serde_with from 3.19.0 to 3.21.0 Bumps [serde_with](https://github.com/jonasbb/serde_with) from 3.19.0 to 3.21.0. - [Release notes](https://github.com/jonasbb/serde_with/releases) - [Commits](https://github.com/jonasbb/serde_with/compare/v3.19.0...v3.21.0) --- updated-dependencies: - dependency-name: serde_with dependency-version: 3.21.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e97ddf92..2f445955 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2328,9 +2328,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.19.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05839ce67618e14a09b286535c0d9c94e85ef25469b0e13cb4f844e5593eb19" +checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" dependencies = [ "serde_core", "serde_with_macros", @@ -2338,9 +2338,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.19.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2ebbe86054f9b45bc3881e865683ccfaccce97b9b4cb53f3039d67f355a334" +checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" dependencies = [ "darling", "proc-macro2", From 060ccb138501e9decceb4d6f798b5ba7e57d401e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 20:09:58 +0000 Subject: [PATCH 08/20] build(deps): bump regex from 1.12.3 to 1.13.1 Bumps [regex](https://github.com/rust-lang/regex) from 1.12.3 to 1.13.1. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.12.3...1.13.1) --- updated-dependencies: - dependency-name: regex dependency-version: 1.12.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f445955..88a0ee30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2183,9 +2183,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.3" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", @@ -2195,9 +2195,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" dependencies = [ "aho-corasick", "memchr", @@ -2206,9 +2206,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rgb" From c2cc79daa747bbbfcdec22bf1eea95a1d1ef8aa2 Mon Sep 17 00:00:00 2001 From: lenamonj Date: Wed, 29 Jul 2026 15:30:07 -0400 Subject: [PATCH 09/20] Fix --sanitize passing through the bidi control characters U+200E, U+200F and U+061C --- src/preprocessor.rs | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/preprocessor.rs b/src/preprocessor.rs index 971ae3d4..a9b8e712 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -168,7 +168,7 @@ pub fn sanitize(line: &str) -> String { #[inline] fn is_sanitize_trigger(b: u8) -> bool { // C0 controls minus \t \n \f; DEL; UTF-8 leads with dangerous codepoints. - matches!(b, 0x00..=0x08 | 0x0B | 0x0D..=0x1F | 0x7F | 0xC2 | 0xE2 | 0xEF) + matches!(b, 0x00..=0x08 | 0x0B | 0x0D..=0x1F | 0x7F | 0xC2 | 0xD8 | 0xE2 | 0xEF) } /// Substitutes the byte/sequence at `bytes[i]` (or passes it through on @@ -200,8 +200,14 @@ fn sanitize_at( buffer.push('\u{FFFD}'); 3 } + // 0xD8 0x9C = U+061C (Arabic letter mark, a bidi control). The rest of + // the 0xD8 block is ordinary Arabic text. + 0xD8 if bytes.get(i + 1) == Some(&0x9C) => { + buffer.push('\u{FFFD}'); + 2 + } // False-alarm trigger: pass the full UTF-8 sequence through. - lead @ (0xC2 | 0xE2 | 0xEF) => { + lead @ (0xC2 | 0xD8 | 0xE2 | 0xEF) => { let n = utf8_len_from_lead(lead); buffer.push_str(&full[i..i + n]); n @@ -217,10 +223,11 @@ fn sanitize_at( #[inline] fn is_dangerous_e2(bytes: &[u8], i: usize) -> bool { - // U+200B..D (zero-width), U+202A..E (bidi controls), U+2066..9 (isolates). + // U+200B..D (zero-width), U+200E..F (LRM/RLM), U+202A..E (bidi embedding + // and override), U+2066..9 (bidi isolates). matches!( (bytes.get(i + 1), bytes.get(i + 2)), - (Some(0x80), Some(0x8B..=0x8D | 0xAA..=0xAE)) | (Some(0x81), Some(0xA6..=0xA9)) + (Some(0x80), Some(0x8B..=0x8F | 0xAA..=0xAE)) | (Some(0x81), Some(0xA6..=0xA9)) ) } @@ -411,6 +418,34 @@ fn test_sanitize_substitutes_bidi_and_zero_width() { assert_eq!(sanitize("a\u{FEFF}b"), format!("a{r}b")); } +#[test] +fn test_sanitize_substitutes_every_bidi_control() { + // Unicode Bidi_Control is exactly these 12 codepoints. Covering only some + // of them leaves a reordering attack available through the rest. + let r = '\u{FFFD}'; + for c in [ + '\u{061C}', '\u{200E}', '\u{200F}', '\u{202A}', '\u{202B}', '\u{202C}', '\u{202D}', + '\u{202E}', '\u{2066}', '\u{2067}', '\u{2068}', '\u{2069}', + ] { + assert_eq!( + sanitize(&format!("a{c}b")), + format!("a{r}b"), + "U+{:04X} was not substituted", + c as u32 + ); + } +} + +#[test] +fn test_sanitize_preserves_arabic_sharing_the_alm_lead_byte() { + // U+061C is reached via lead byte 0xD8, which also leads ordinary Arabic. + assert_eq!( + sanitize("\u{0600}\u{061F}\u{06FF}"), + "\u{0600}\u{061F}\u{06FF}" + ); + assert_eq!(sanitize("مرحبا بالعالم"), "مرحبا بالعالم"); +} + #[test] fn test_sanitize_preserves_legitimate_bytes() { assert_eq!(sanitize("crlf\r\nline\r\n"), "crlf\r\nline\r\n"); From df382256532b96da7cc8eba8fb5dca2d67c5d8ce Mon Sep 17 00:00:00 2001 From: lenamonj Date: Wed, 29 Jul 2026 15:38:59 -0400 Subject: [PATCH 10/20] Add CHANGELOG entry for #3862 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cf4f8f7..7e0abc18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ ## Bugfixes - Fix `--list-languages` respecting `--paging=never`, see #3828 (@cyphercodes) +- Fix `--sanitize` passing through the bidi control characters U+200E, U+200F and U+061C, see #3862 (@lenamonj) - `--strip-ansi`: also strip 8-bit C1 introducers (U+0090, U+0098, U+009B, U+009D, U+009E, U+009F) and DCS/SOS/PM/APC sequence bodies, which previously passed through. See #3729 (@curious-rabbit) - Fix `--ignored-suffix` not falling back to first-line/shebang detection when the ignored suffix is also a registered extension (e.g. `--ignored-suffix .txt` on a shebang script), see #2745 and #3816 (@adnrivera) - Fix `capacity overflow` panic when printing a snip separator at `--terminal-width=1` with multiple line ranges. Closes #3803, see #3804 (@leeewee) From 969b33dad145249cbb5f1d3e5d60deb157dde8d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:03:54 +0000 Subject: [PATCH 11/20] build(deps): bump proc-macro2 from 1.0.106 to 1.0.107 Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.106 to 1.0.107. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.106...1.0.107) --- updated-dependencies: - dependency-name: proc-macro2 dependency-version: 1.0.107 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88a0ee30..5be0c644 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2112,9 +2112,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] From e6ac6ce08dfe3c5f7f761dda5c7a29d8fdaf2abb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:38:14 +0000 Subject: [PATCH 12/20] build(deps): bump execute from 0.2.15 to 0.3.0 Bumps [execute](https://github.com/magiclen/execute) from 0.2.15 to 0.3.0. - [Commits](https://github.com/magiclen/execute/compare/v0.2.15...v0.3.0) --- updated-dependencies: - dependency-name: execute dependency-version: 0.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 31 ++++++++++--------------------- Cargo.toml | 2 +- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5be0c644..0467f4a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,7 +221,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -466,7 +466,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ - "generic-array 0.14.7", + "generic-array", "typenum", ] @@ -680,29 +680,28 @@ dependencies = [ [[package]] name = "execute" -version = "0.2.15" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be3cc61fe54b4cae4463cdbda0401978ffe19d4dcc7a5201a312cddf64726dd" +checksum = "a8bc8fa7331f8c9f97fb52c60c4e1d07fd424db18130cb252b1da7c6bbcfc2c9" dependencies = [ "execute-command-macro", "execute-command-tokens", - "generic-array 1.4.1", ] [[package]] name = "execute-command-macro" -version = "0.1.11" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e748391d89b43c52decaed8645b4a83a09d14f5ee868071c6813389e9e7036" +checksum = "889365b82d31077b07ed81c1b37f49eed80266f57c99bc3706e8d8d4783388ac" dependencies = [ "execute-command-macro-impl", ] [[package]] name = "execute-command-macro-impl" -version = "0.1.12" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57dd896da3fbb77138059b015c013459d96063c66bcdd3b9094ff2e9d3f19a47" +checksum = "581bbece7790a10aa1c40586be3be5b6f466f0a608386885a81924df372fd530" dependencies = [ "execute-command-tokens", "quote", @@ -711,9 +710,9 @@ dependencies = [ [[package]] name = "execute-command-tokens" -version = "0.1.9" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729eda2ea2f6c5ef85150c85a9b2ce0a8e01f040e59cdb32521eaa6c840c9d51" +checksum = "9ef469ea74199a1c75f76f5176e18e4a8864caa6b7ca528c97a5f5fe67c94902" [[package]] name = "expect-test" @@ -815,16 +814,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "generic-array" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab9e9188e97a93276e1fe7b56401b851e2b45a46d045ca658100c1303ada649" -dependencies = [ - "rustversion", - "typenum", -] - [[package]] name = "getrandom" version = "0.4.2" diff --git a/Cargo.toml b/Cargo.toml index b6b1cb1a..3baddf5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,7 @@ regex = { version = "1.12.3", optional = true } walkdir = { version = "2.5", optional = true } bytesize = { version = "2.3.1" } encoding_rs = "0.8.35" -execute = { version = "0.2.15", optional = true } +execute = { version = "0.3.0", optional = true } terminal-colorsaurus = "1.0" unicode-segmentation = "1.13.2" itertools = "0.14.0" From 6573ca9307291edbc27cf04c9e64dc102fb225a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:09:37 +0000 Subject: [PATCH 13/20] build(deps): bump terminal-colorsaurus from 1.0.0 to 1.0.3 Bumps [terminal-colorsaurus](https://github.com/tautropfli/terminal-colorsaurus) from 1.0.0 to 1.0.3. - [Release notes](https://github.com/tautropfli/terminal-colorsaurus/releases) - [Changelog](https://github.com/tautropfli/terminal-colorsaurus/blob/main/changelog.md) - [Commits](https://github.com/tautropfli/terminal-colorsaurus/compare/1.0.0...1.0.3) --- updated-dependencies: - dependency-name: terminal-colorsaurus dependency-version: 1.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0467f4a7..0e426040 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -79,7 +79,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -354,7 +354,7 @@ dependencies = [ "encode_unicode", "libc", "unicode-width", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -665,7 +665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -675,7 +675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96" dependencies = [ "cfg-if", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -1414,7 +1414,7 @@ dependencies = [ "bitflags 2.11.1", "gix-path", "libc", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -1865,7 +1865,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -1907,7 +1907,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -2227,7 +2227,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -2536,7 +2536,7 @@ dependencies = [ "getrandom", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -2550,16 +2550,16 @@ dependencies = [ [[package]] name = "terminal-colorsaurus" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7226dad4b1817567c1e2f5d453897ef36abe79def7783af3fa241a694e30b3" +checksum = "7a46bb5364467da040298c573c8a95dbf9a512efc039630409a03126e3703e90" dependencies = [ "cfg-if", "libc", "memchr", "mio", "terminal-trx", - "windows-sys 0.59.0", + "windows-sys", "xterm-color", ] @@ -2571,7 +2571,7 @@ checksum = "3b3f27d9a8a177e57545481faec87acb45c6e854ed1e5a3658ad186c106f38ed" dependencies = [ "cfg-if", "libc", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -2581,7 +2581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -2875,7 +2875,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -2987,15 +2987,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.61.2" From 1cf12d49bda67f3f26ee0e26d1ab72ccc2e844a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:33:08 +0000 Subject: [PATCH 14/20] build(deps): bump gix from 0.85.0 to 0.86.0 Bumps [gix](https://github.com/GitoxideLabs/gitoxide) from 0.85.0 to 0.86.0. - [Release notes](https://github.com/GitoxideLabs/gitoxide/releases) - [Changelog](https://github.com/GitoxideLabs/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/GitoxideLabs/gitoxide/compare/gix-v0.85.0...gix-v0.86.0) --- updated-dependencies: - dependency-name: gix dependency-version: 0.86.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 258 +++++++++++++++++++++++++++-------------------------- Cargo.toml | 2 +- 2 files changed, 133 insertions(+), 127 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e426040..3a46f154 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,6 +188,21 @@ dependencies = [ "serde", ] +[[package]] +name = "bisync" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5020822f6d6f23196ccaf55e228db36f9de1cf788052b37992e17cbc96ec41a7" +dependencies = [ + "bisync_macros", +] + +[[package]] +name = "bisync_macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d21f40d350a700f6aa107e45fb26448cf489d34794b2ba4522181dc9f1173af6" + [[package]] name = "bit-set" version = "0.8.0" @@ -519,9 +534,9 @@ dependencies = [ [[package]] name = "dashmap" -version = "6.1.0" +version = "6.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c" dependencies = [ "cfg-if", "crossbeam-utils", @@ -849,9 +864,9 @@ dependencies = [ [[package]] name = "gix" -version = "0.85.0" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8b2e38ebfc4484dfef8580ddcaf8abb7285e6f3eb6413ff6775d104ae96ca6" +checksum = "bb3790fd8981cba7949f1ba924ef865d902df731627bc5998d14164063892fce" dependencies = [ "gix-actor", "gix-attributes", @@ -892,6 +907,7 @@ dependencies = [ "gix-validate", "gix-worktree", "gix-worktree-stream", + "gix-zlib", "nonempty", "smallvec", "thiserror", @@ -899,9 +915,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.41.1" +version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc998b8f746dda8565450d08a63b792ced9165d8c27a1ed3f02799ec6a7820f" +checksum = "33f9308ad6fd35b2a865cbe4117ac61b2be59e4a9ef1621c7a9794f7c8e52c5b" dependencies = [ "bstr", "gix-date", @@ -910,16 +926,16 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.33.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39b40888d0ed415c0744a6cdc61eebf0304c9d26ab726725b718443c322e5ba4" +checksum = "c31c593692ebdc1e38858d9a2b56f6a594c501e24a38971fe6685571f5a07be0" dependencies = [ "bstr", + "gix-features", "gix-glob", "gix-path", "gix-quote", "gix-trace", - "kstring", "smallvec", "thiserror", "unicode-bom", @@ -927,18 +943,18 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ebef0c26ad305747649e727bbcd56a7b7910754eb7cea88f6dff6f93c51283" +checksum = "7cd1d118d0f5d88b96e6f6e13b566475fef4797ead4a02c26fed36c1375066f7" dependencies = [ "gix-error", ] [[package]] name = "gix-chunk" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9faee47943b638e58ddd5e275a4906ad3e4b6c8584f1d41bd18ab9032ec52afb" +checksum = "b2a871e5cab12ba568845714473505deefffb3c04eb47f4708ce344cd459c1cc" dependencies = [ "gix-error", ] @@ -958,9 +974,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.37.1" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f675d0df484a7f6a47e64bd6f311af489d947c0323b0564f36d14f3d7762abb" +checksum = "a2cd7f054ae2727223fe46dd39c012f066b12f532962d336d29ee193261787da" dependencies = [ "bstr", "gix-chunk", @@ -972,9 +988,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.58.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a29bf266c4cdaf759e535c24ad4ce655b987aeb6911075643403cc7cc5ade583" +checksum = "103d11bef95c467577ecfa8b7b86a22e65af3507b2c9bfa3809a4afbae7df301" dependencies = [ "bstr", "gix-config-value", @@ -983,6 +999,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", + "gix-utils", "smallvec", "thiserror", "unicode-bom", @@ -990,9 +1007,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed42168329552f6c2e5df09665c104199d45d84bedb53683738a49b57fe1baab" +checksum = "9f813e312a3f7f327187823cd4c754a3e4d948c98907d11e8f37554a2b6b8059" dependencies = [ "bitflags 2.11.1", "bstr", @@ -1003,9 +1020,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d63f9e28b59ddeb1a1eb9e5cf986a9222b5d484947445edbc20473939cc7fd0" +checksum = "7e47b9e8cdc688296609b706428de570f88b1e0eed7156dde7b4a89d26fa4567" dependencies = [ "bstr", "gix-error", @@ -1015,9 +1032,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.65.0" +version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c6d56c94edf92d78203a1cd416f770e35e10b6955ede6b9d7d0c22ff88a5f3" +checksum = "fee7d89a3c507491cdfc57a1d1e0e300214720b4f7709ebc253e422f99822bfc" dependencies = [ "bstr", "gix-command", @@ -1036,9 +1053,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d624d5b23b10c1d85337645227abe353ac95ab8ff66a7bdd5ce689b2db33a722" +checksum = "b9f517766fa1101dfe2606c1a19a8ffa699099030995a9194445446dfe261bdf" dependencies = [ "bstr", "dunce", @@ -1051,37 +1068,37 @@ dependencies = [ [[package]] name = "gix-error" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57831e199be480af90dcd7e459abed8a174c09ec9a6e2cc8f7ca6c54598b06b" +checksum = "4a9292309fd944e71b2a3c96d3c03a6feb8852db646febdde7cbb9f79cb5f329" dependencies = [ "bstr", ] [[package]] name = "gix-features" -version = "0.48.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1849ae154d38bc403185be14fa871e38e3c93ee606875d94e207fdb9fba52dbc" +checksum = "20aa09e83a48dc02c5f5f08578aa79d3ab1bab4618b8c362f88684645a02bdcc" dependencies = [ "bytes", "crc32fast", + "crossbeam-channel", "gix-path", "gix-trace", "gix-utils", "libc", "once_cell", + "parking_lot", "prodash", - "thiserror", "walkdir", - "zlib-rs", ] [[package]] name = "gix-filter" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6644fb2ef97928c278675b239f366b457103d7e436f811d27331a8daf212759c" +checksum = "5e7b5dbf524d97e839f642930c76d7f011c0791e7d11d8148989ac5af7c76aa8" dependencies = [ "bstr", "encoding_rs", @@ -1100,12 +1117,11 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cdff46db8798e47e2f727d84b9379aac5add3dd3d9d0b07bb4d7d5d640771fe" +checksum = "865cf13fcaf5455220546cb9607c416bd1be9a6caafd143655a362fdeab64e80" dependencies = [ "bstr", - "fastrand", "gix-features", "gix-path", "gix-utils", @@ -1114,9 +1130,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.26.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fcb8ef5b16bcf874abe9b68d8abb3c0493c876d367ab824151f30a0f3f3756" +checksum = "421e92a711554fa5827d1b0599d3389acdd0f6729e97a8c5a57d79af1e50bf36" dependencies = [ "bitflags 2.11.1", "bstr", @@ -1126,9 +1142,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0926d3819c837750b4e03c7754901e73f68b8c9b690753a6372a1bed4eedce" +checksum = "13adaa73415fd6c902310923f68d0b98e8cecf14b33ea58c02cc387cee56f54e" dependencies = [ "faster-hex", "gix-features", @@ -1138,9 +1154,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e261d54091f0d1c729bc83f54548c071bdec60a697de1e58e88bdfd7a99d24e" +checksum = "78fccd6fea3bcf0b39c076bae60ae49b08daaf538b950202101a981f9d3c01d3" dependencies = [ "gix-hash", "hashbrown 0.17.1", @@ -1149,9 +1165,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d491bab9bf2c9f341dc754f425c31d5d3f63aca615312167b82e1deeaca97d8d" +checksum = "12cff8e8aa125e39377456073e63df3334d9e5741372ddcc226198015076dda2" dependencies = [ "bstr", "gix-glob", @@ -1162,9 +1178,9 @@ dependencies = [ [[package]] name = "gix-imara-diff" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b305d85504de270ad3525d726a6b69cc59ee7b2269b014387651107ab9f0755b" +checksum = "1a791e6620676a875f362f3156ed213e73ca099a09bf992c18812abe65cc37b1" dependencies = [ "bstr", "hashbrown 0.17.1", @@ -1172,9 +1188,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36d45f82ec5a4d7542ea595e9ad16e03e26c8cb4f221e5bc9fcdcf469f63a681" +checksum = "5009c4e7e9f9b4cfaaab1153e49133eb04d79c015b5702d6c3d2ab94271a89c6" dependencies = [ "bitflags 2.11.1", "bstr", @@ -1200,9 +1216,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3bc074e5723027b482dcd9ab99d95804a53742f6de812d0172fbba4a186c1" +checksum = "d4c69157820343bf1c6e4b88b9808e920900de02e18aaf5862b30ada43814848" dependencies = [ "gix-tempfile", "gix-utils", @@ -1211,9 +1227,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "019b38afc3eac1e41f9fe09a327664b313ba4a120fa5f40e3678795d0e42783e" +checksum = "0e48c235e7f886eb819fc878af75be889333dd3c38bee02ed7af48ae2cf596c4" dependencies = [ "bstr", "gix-actor", @@ -1230,9 +1246,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.82.0" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fadc59f6fa0f9dd445eceee61060a2b59ca557f48da9fc677f567db535b782a" +checksum = "8dd494ffb5037e62b8220109e894d2861ff2150a2cacbfccdba57ae1ebab2b96" dependencies = [ "arc-swap", "gix-features", @@ -1243,6 +1259,7 @@ dependencies = [ "gix-pack", "gix-path", "gix-quote", + "gix-zlib", "memmap2", "parking_lot", "tempfile", @@ -1251,9 +1268,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.72.0" +version = "0.73.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3e7f1726cd2c0cd1cf1fc20be8a8e623f0b163f1f8d6fc836cfb9bc8cd758b" +checksum = "6d5446127b269706e85998065267ddd2ccc3550179da6780b22fe496175ccb20" dependencies = [ "clru", "gix-chunk", @@ -1263,6 +1280,7 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-path", + "gix-zlib", "memmap2", "smallvec", "thiserror", @@ -1270,9 +1288,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.21.5" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b217dd0ee0c4021ecf169a4a519b1b4f80d15e3f3765f3dc466223dc0ac891d7" +checksum = "3766025c72319c4accdd854a18e6f0dd176c8eb0f3bc8a60a7765be2b50cabf2" dependencies = [ "bstr", "faster-hex", @@ -1282,9 +1300,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa6ac14cd14939ea94a496ce7460daa6511c09f5b84757e9cfc6f9c8d0f93a6" +checksum = "1ed3e8d7a82e886e17a72e03d4ba0c13db6f2219b6cd4e2900b4cae426ec20c9" dependencies = [ "bstr", "gix-trace", @@ -1294,9 +1312,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3050783b41ee11511e1e8fb35623df81806194f4030395f14f48ea37c2798c9f" +checksum = "49f6fa5f8007f008187c3f60b4373209ca83d1cc947f35ede03e16cd15a4d137" dependencies = [ "bitflags 2.11.1", "bstr", @@ -1309,10 +1327,11 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.63.0" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978468bae4ea2df20c72db3b20d0bdb548a0c1090b85a83643b553e6e0e041f2" +checksum = "dede40e89c1e90f548415f50636bb051f6d9c60f68b8b710bc07825722d19588" dependencies = [ + "bisync", "bstr", "gix-date", "gix-features", @@ -1321,7 +1340,6 @@ dependencies = [ "gix-shallow", "gix-transport", "gix-utils", - "maybe-async", "nonempty", "thiserror", ] @@ -1339,9 +1357,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.65.0" +version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bbfbce1dfd7d7f8469ddef6d3518376aff664348f153cbe0fc3e58ef993d24e" +checksum = "eeb0c90a8f6202ceaaa22996cbf837c943ccb2d8af9ff3490f0758305e6b7883" dependencies = [ "gix-actor", "gix-features", @@ -1359,9 +1377,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc36a4fb1a1540b59cf2da498783080743fa274b02a3f19ca444fc4015a9d4f" +checksum = "7406282cc0259b51f6aee299ca3d31279a020530363152a2e6c96e8a7f7bbc83" dependencies = [ "bstr", "gix-error", @@ -1375,9 +1393,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "885075c3c21eb9c06e0be3b3728ba5932c04e1c1011dcee7c81801980e3e986f" +checksum = "e55e09d4a1ecf2beecc8c09cafcad37979e805b31f588b0e957e191df5783681" dependencies = [ "bstr", "gix-commitgraph", @@ -1391,9 +1409,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f11fe7ca2585193d3d70bbe0be175a2008d883a704cc7a55e454e113e689455" +checksum = "36c113c0a53294dc6280ffc06cbcc4f50f820397e97d6a00b429a44b8db26e29" dependencies = [ "gix-commitgraph", "gix-date", @@ -1407,9 +1425,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8519976e4c7e486270740a5400369f37940779b80bd1377d94cfa1125d01b3" +checksum = "af4fe6c152c1d50aea36f299825702cd37e303307832fec1d0fdd5844e47ce2f" dependencies = [ "bitflags 2.11.1", "gix-path", @@ -1419,9 +1437,9 @@ dependencies = [ [[package]] name = "gix-shallow" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a292fc2fe548c5dfa575479d16b445b0ddf1dd2f56f1fec6aed386f82553cd97" +checksum = "1ecc9f4b40537043e4bbd7d3d1760e74fb8e7b07a546166b558acaa73ad97f4a" dependencies = [ "bstr", "gix-hash", @@ -1432,9 +1450,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f9f594f7cbda0b38ba6b633b3e9a7b7901acdc5d27bc186a16633800cd1ac8" +checksum = "5fd98077a56d08886112e6b08dc94076d03539f4bc0b9d7880e4be2b8a640d8c" dependencies = [ "bstr", "gix-config", @@ -1447,11 +1465,11 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "691ea1e31435c7e7d4d04705ec9d1c0d9482c46b2acf512bc723939d8f0af7fb" +checksum = "b675b920bd5a61d17ad542772f03ec34c60feb8ff683e1560c03ae967363731e" dependencies = [ - "dashmap 6.1.0", + "dashmap 6.2.1", "gix-fs", "libc", "parking_lot", @@ -1460,20 +1478,21 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44dc45eae785c0eb14173e0f152e6e224dcf4d45b6a6999a3aed22af541ad678" +checksum = "be3eb81d9dc914335923e50d52829c551feefd6a72d176c4130c546b67a60814" [[package]] name = "gix-transport" -version = "0.57.2" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186874f7ad1fb2f9a2f2aa9c2dabc7f9dd087bef74c1a0eee2b4a9cf0248fcb3" +checksum = "b7c1bcf30081eb8ab04540a5795c67a2fcb22cb2e976e8b1a4ea657b1ed61469" dependencies = [ "bstr", "gix-command", "gix-features", "gix-packetline", + "gix-path", "gix-quote", "gix-sec", "gix-url", @@ -1482,9 +1501,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.59.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5062cca8f2977565bbaf666ec31dbdb9bc9d9293beb65f9bec52e6c1121b62a1" +checksum = "008c5cd879e46e86b5c2469e633611978b18775d53d05668d691bc13088bd409" dependencies = [ "bitflags 2.11.1", "gix-commitgraph", @@ -1499,40 +1518,43 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bb01ec69d55e82ccb7a19e264501ead4e6aac38463a8cebfdd81e22bb67ab2" +checksum = "42d10e53b8eae21ee601687f47bbbd6cb2ed7162cb4c1cafdd422fb7ec64cbee" dependencies = [ "bstr", "gix-path", + "gix-utils", "percent-encoding", "thiserror", ] [[package]] name = "gix-utils" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c50966184123caf580ffa64e28031a878597f1c7fceb8fe19566c38eb1b771" +checksum = "b1795bd2a970ca8b2185318c2abb97d955c71992f1cf28de73ad3b593a9f3ce8" dependencies = [ + "bstr", "fastrand", + "getrandom", "unicode-normalization", ] [[package]] name = "gix-validate" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc6fc771c4063ba7cd2f47b91fb6076251c6a823b64b7fe7b8874b0fe4afae3" +checksum = "9a034e84d1e04e1b1f20f51f12491da230b6ac8b925d0c8e1b89bcd87a7c5ccc" dependencies = [ "bstr", ] [[package]] name = "gix-worktree" -version = "0.54.0" +version = "0.55.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92399ed66f259592050c6ed9dc80105e095a2f8e87e6b83d98aa2e21d8e27036" +checksum = "31eb8e675122e83585e461fe28f68ff8c5ed55b49017b697e7e76423ff973424" dependencies = [ "bstr", "gix-attributes", @@ -1548,9 +1570,9 @@ dependencies = [ [[package]] name = "gix-worktree-stream" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f3a878c89a05470ad98c644b0015777c530da24854dd29e41fe4f41176840f" +checksum = "3b088c8724e7be120c4798dd86925cf05332c9d356a463542578600c50c7a549" dependencies = [ "gix-attributes", "gix-error", @@ -1564,6 +1586,16 @@ dependencies = [ "parking_lot", ] +[[package]] +name = "gix-zlib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e8813f5579b3075ff9c90f7c59cd2b62b4ebb639361f0911648b22d7446cc7c" +dependencies = [ + "thiserror", + "zlib-rs", +] + [[package]] name = "glob" version = "0.3.3" @@ -1746,15 +1778,6 @@ dependencies = [ "jiff-tzdb", ] -[[package]] -name = "kstring" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558bf9508a558512042d3095138b1f7b8fe90c5467d94f9f1da28b3731c5dbd1" -dependencies = [ - "static_assertions", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -1806,17 +1829,6 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -[[package]] -name = "maybe-async" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "746873a384ad60adc5db74471dfaba74bd278afbdcfd81db93fafcdfc8b5ca0c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "memchr" version = "2.8.0" @@ -1825,9 +1837,9 @@ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "memmap2" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" dependencies = [ "libc", ] @@ -2461,12 +2473,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "std_prelude" version = "0.2.12" diff --git a/Cargo.toml b/Cargo.toml index 3baddf5b..8d8a3be1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,7 +76,7 @@ unicode-segmentation = "1.13.2" itertools = "0.14.0" [dependencies.gix] -version = "0.85" +version = "0.86" optional = true default-features = false features = ["sha1", "blob-diff"] From d3448444863f7ad635e44e14ca73b45b03dda896 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:50:26 +0000 Subject: [PATCH 15/20] build(deps): bump minus from 5.7.1 to 5.7.2 Bumps [minus](https://github.com/AMythicDev/minus) from 5.7.1 to 5.7.2. - [Changelog](https://github.com/AMythicDev/minus/blob/main/CHANGELOG.md) - [Commits](https://github.com/AMythicDev/minus/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: minus dependency-version: 5.7.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a46f154..f04a37ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1856,9 +1856,9 @@ dependencies = [ [[package]] name = "minus" -version = "5.7.1" +version = "5.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2657ec5f6a6edc55a85c8db0c572436b612eb036af00e7eee47e0a622095ed96" +checksum = "1db1df1b8dd701aa57b41283b50b751b3ebc8fe1406955ec90c53b46b475fa56" dependencies = [ "crossbeam-channel", "crossterm", From db69aab106ed01d78c788f5961daed1888e91a24 Mon Sep 17 00:00:00 2001 From: Matei6942 Date: Sun, 2 Aug 2026 10:52:05 +0300 Subject: [PATCH 16/20] fix(syntax): avoid repeated log level scans --- assets/syntaxes/02_Extra/log.sublime-syntax | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/syntaxes/02_Extra/log.sublime-syntax b/assets/syntaxes/02_Extra/log.sublime-syntax index 0ce01f10..acd14216 100644 --- a/assets/syntaxes/02_Extra/log.sublime-syntax +++ b/assets/syntaxes/02_Extra/log.sublime-syntax @@ -38,19 +38,20 @@ contexts: scope: markup.underline.link.scheme.log push: url-host log_level_lines: - - match: (?=.*{{error}}) + # Prevent retrying each lookahead at every position. + - match: \G(?=.*{{error}}) push: - error_line_meta - main_pop_at_eol - - match: (?=.*{{warning}}) + - match: \G(?=.*{{warning}}) push: - warning_line_meta - main_pop_at_eol - - match: (?=.*{{info}}) + - match: \G(?=.*{{info}}) push: - info_line_meta - main_pop_at_eol - - match: (?=.*{{debug}}) + - match: \G(?=.*{{debug}}) push: - debug_line_meta - main_pop_at_eol From 531d54b110d9b2311ab852e728ad1448d808ae03 Mon Sep 17 00:00:00 2001 From: Matei6942 Date: Sun, 2 Aug 2026 10:52:39 +0300 Subject: [PATCH 17/20] docs: add changelog entry for #3876 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0abc18..a2819429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Syntax highlighting for Python files using uv as script runner in shebang #3689 (@janlarres) ## Bugfixes +- Avoid repeated scans of long lines in Log syntax highlighting, see #3876 (@Matei02355) - Fix `--list-languages` respecting `--paging=never`, see #3828 (@cyphercodes) - Fix `--sanitize` passing through the bidi control characters U+200E, U+200F and U+061C, see #3862 (@lenamonj) - `--strip-ansi`: also strip 8-bit C1 introducers (U+0090, U+0098, U+009B, U+009D, U+009E, U+009F) and DCS/SOS/PM/APC sequence bodies, which previously passed through. See #3729 (@curious-rabbit) From a58f23724a84bab02dbacf4e573fe702d7f84fe8 Mon Sep 17 00:00:00 2001 From: latent-9 <296084221+latent-9@users.noreply.github.com> Date: Sun, 9 Aug 2026 18:05:20 +1200 Subject: [PATCH 18/20] Fix doubled word in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eb4c095..8826d4e0 100644 --- a/README.md +++ b/README.md @@ -902,7 +902,7 @@ cargo install --path . --locked --force ``` If you want to build an application that uses `bat`'s pretty-printing -features as a library, check out the [the API documentation](https://docs.rs/bat/). +features as a library, check out the [API documentation](https://docs.rs/bat/). Note that you have to use either `regex-onig` or `regex-fancy` as a feature when you depend on `bat` as a library. From 3ca4a01be6bef5ba7c32c4cacc285e60bf66426e Mon Sep 17 00:00:00 2001 From: Matei6942 Date: Mon, 10 Aug 2026 20:00:44 +0300 Subject: [PATCH 19/20] fix(syntax): use start-of-line anchor for log levels --- assets/syntaxes/02_Extra/log.sublime-syntax | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/syntaxes/02_Extra/log.sublime-syntax b/assets/syntaxes/02_Extra/log.sublime-syntax index acd14216..5a4a0e06 100644 --- a/assets/syntaxes/02_Extra/log.sublime-syntax +++ b/assets/syntaxes/02_Extra/log.sublime-syntax @@ -39,19 +39,19 @@ contexts: push: url-host log_level_lines: # Prevent retrying each lookahead at every position. - - match: \G(?=.*{{error}}) + - match: ^(?=.*{{error}}) push: - error_line_meta - main_pop_at_eol - - match: \G(?=.*{{warning}}) + - match: ^(?=.*{{warning}}) push: - warning_line_meta - main_pop_at_eol - - match: \G(?=.*{{info}}) + - match: ^(?=.*{{info}}) push: - info_line_meta - main_pop_at_eol - - match: \G(?=.*{{debug}}) + - match: ^(?=.*{{debug}}) push: - debug_line_meta - main_pop_at_eol From cecbb80093a42690f8f432c37b5c279af2214615 Mon Sep 17 00:00:00 2001 From: Matei6942 Date: Mon, 10 Aug 2026 20:56:35 +0300 Subject: [PATCH 20/20] fix(syntax): preserve log-level scopes in Syslog --- assets/syntaxes/02_Extra/log.sublime-syntax | 18 ++++++++++++++++++ assets/syntaxes/02_Extra/syslog.sublime-syntax | 12 +++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/assets/syntaxes/02_Extra/log.sublime-syntax b/assets/syntaxes/02_Extra/log.sublime-syntax index 5a4a0e06..329da39d 100644 --- a/assets/syntaxes/02_Extra/log.sublime-syntax +++ b/assets/syntaxes/02_Extra/log.sublime-syntax @@ -55,6 +55,24 @@ contexts: push: - debug_line_meta - main_pop_at_eol + # For syntaxes that embed Log after consuming a prefix. Call this context once. + log_level_lines_at_current_position: + - match: (?=.*{{error}}) + set: + - error_line_meta + - main_pop_at_eol + - match: (?=.*{{warning}}) + set: + - warning_line_meta + - main_pop_at_eol + - match: (?=.*{{info}}) + set: + - info_line_meta + - main_pop_at_eol + - match: (?=.*{{debug}}) + set: + - debug_line_meta + - main_pop_at_eol log_levels: - match: '{{error}}' scope: markup.error.log diff --git a/assets/syntaxes/02_Extra/syslog.sublime-syntax b/assets/syntaxes/02_Extra/syslog.sublime-syntax index 01ed58db..7cc9580b 100644 --- a/assets/syntaxes/02_Extra/syslog.sublime-syntax +++ b/assets/syntaxes/02_Extra/syslog.sublime-syntax @@ -50,6 +50,17 @@ contexts: - match: (?=\]) pop: true text: + - include: text_special + - match: '' + set: classify_log_text + classify_log_text: + - include: scope:text.log#log_level_lines_at_current_position + - match: '' + set: text_body + text_body: + - include: text_special + - include: scope:text.log + text_special: - match: $ pop: true - match: '<\w+>' @@ -62,4 +73,3 @@ contexts: escape: \)$ escape_captures: 0: punctuation.section.block.end.syslog - - include: scope:text.log