syntect-no-panic

Crates.iosyntect-no-panic
lib.rssyntect-no-panic
version6.0.0
created_at2022-01-23 12:15:38.185223+00
updated_at2025-01-03 07:03:39.068187+00
descriptiontemporary fork of Syntect
homepage
repositoryhttps://github.com/Canop/syntect
max_upload_size
id519645
size1,355,889
Denys Séguret (Canop)

documentation

https://docs.rs/syntect-no-panic

README

syntect-no-panic

This is a fork of Syntect.

This fork is very similar to the original version 5.2 of Syntect, but modified to avoid panicking.

With this fork, the behavior on a syntax having an invalid rule isn't to panic anymore, and is tuned with options:

let options = HighlightOptions {
    ignore_errors: true,
    ..Default::default()
};
HighlightLines::new(syntax, theme, options)

With ignore_errors: false, a faulty regex in a syntax, detected when highlighting some lines, will result in an error.

With ignore_errors: true, the rule containing the faulty regex won't be applied but rest of the highlighting process will proceed.

Please try to use the original Syntect instead of this temporary fork.

There's no project to add features: as soon as I can use the normal syntect, this repository will be considered obsolete to avoid fragmenting the ecosystem.

If you really feel like you need to use this, contact @dystroy on the Miaou chat.

Commit count: 1038

cargo fmt