diff --git a/Cargo.lock b/Cargo.lock index 60b281de..a6853d6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2455,7 +2455,7 @@ name = "iced_highlighter" version = "0.14.0-dev" dependencies = [ "iced_core", - "syntect", + "two-face", ] [[package]] @@ -6216,6 +6216,17 @@ dependencies = [ "utf-8", ] +[[package]] +name = "two-face" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d112cfd41c1387546416bcf49c4ae2a1fcacda0d42c9e97120e9798c90c0923" +dependencies = [ + "serde", + "serde_derive", + "syntect", +] + [[package]] name = "typenum" version = "1.19.0" diff --git a/Cargo.toml b/Cargo.toml index 7b92ddaf..08242e8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -221,12 +221,12 @@ sipper = "0.1" smol = "2" smol_str = "0.2" softbuffer = { version = "0.4", default-features = false } -syntect = { version = "5", default-features = false, features = ["default-fancy"] } sysinfo = "0.33" thiserror = "2" tiny-skia = { version = "0.11", default-features = false, features = ["std", "simd"] } tokio = "1.0" tracing = "0.1" +two-face = { version = "0.4", default-features = false, features = ["syntect-default-fancy"] } unicode-segmentation = "1.0" url = "2.5" wasm-bindgen-futures = "0.4" diff --git a/highlighter/Cargo.toml b/highlighter/Cargo.toml index 4c20a678..664b6940 100644 --- a/highlighter/Cargo.toml +++ b/highlighter/Cargo.toml @@ -16,4 +16,4 @@ workspace = true [dependencies] iced_core.workspace = true -syntect.workspace = true +two-face.workspace = true diff --git a/highlighter/src/lib.rs b/highlighter/src/lib.rs index 982f1279..3066f362 100644 --- a/highlighter/src/lib.rs +++ b/highlighter/src/lib.rs @@ -10,9 +10,10 @@ use std::sync::LazyLock; use syntect::highlighting; use syntect::parsing; +use two_face::re_exports::syntect; static SYNTAXES: LazyLock = - LazyLock::new(parsing::SyntaxSet::load_defaults_nonewlines); + LazyLock::new(two_face::syntax::extra_no_newlines); static THEMES: LazyLock = LazyLock::new(highlighting::ThemeSet::load_defaults);