Skip to content

Commit

Permalink
Use a new version of the forked syntect
Browse files Browse the repository at this point in the history
to have non compiling regexes catched

Fix #967
  • Loading branch information
Canop committed Dec 30, 2024
1 parent 23e7f77 commit 39eeeda
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
28 changes: 11 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "broot"
version = "1.44.3"
version = "1.44.4-dev"
authors = ["dystroy <[email protected]>"]
repository = "https://github.com/Canop/broot"
homepage = "https://dystroy.org/broot"
Expand Down Expand Up @@ -57,7 +57,7 @@ serde = { version = "1.0", features = ["derive"] }
smallvec = "1.11" # version 2 is still alpha
splitty = "1.0.2"
strict = "0.1.4"
syntect = { package = "syntect-no-panic", version = "4.6.1", default-features = false, features = ["default-fancy"] } # see issues #485 and #956
syntect = { package = "syntect-5-no-panic", version = "5.2", default-features = false, features = ["default-fancy"] } # see issues #485, #956, #967
tempfile = "3.2"
termimad = "0.31"
terminal-clipboard = { version = "0.4.1", optional = true }
Expand Down Expand Up @@ -118,8 +118,7 @@ harness = false
# lfs-core = { path = "../lfs-core" }
# minimad = { path = "../minimad" }
# secular = { path = "../secular", features=["normalization"] }
# syntect = { path = "../syntect" }
# syntect-no-panic = { path = "../syntect" }
# syntect-5-no-panic = { path = "../syntect" }
# termimad = { path = "../termimad" }
# terminal-clipboard = { path = "../terminal-clipboard" }
# terminal-light = { path = "../terminal-light" }
Expand Down
Binary file modified resources/syntect/syntaxes.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions src/syntactic/syntactic_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ impl SyntacticView {
// Those chars are removed on printing
let name_match = pattern.search_string(&line);
let regions = if let Some(highlighter) = highlighter.as_mut() {
highlighter
.highlight(&line, &SYNTAXER.syntax_set)
highlighter
.highlight_line(&line, &SYNTAXER.syntax_set)
.map_err(|e| ProgramError::SyntectCrashed { details: e.to_string() })?
.iter()
.map(Region::from_syntect)
Expand Down
5 changes: 4 additions & 1 deletion src/syntactic/syntaxer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ pub struct Syntaxer {
impl Default for Syntaxer {
fn default() -> Self {
Self {
syntax_set: time!(Debug, syntect::dumps::from_binary(SYNTAXES)),
syntax_set: time!(
Debug,
syntect::dumps::from_uncompressed_data(SYNTAXES).unwrap()
),
theme_set: ThemeSet::load_defaults(),
}
}
Expand Down

0 comments on commit 39eeeda

Please sign in to comment.