Support more syntaxes for highlighting with two-face
Co-authored-by: Redhawk18 <redhawk76767676@gmail.com>
This commit is contained in:
parent
aa8c0c3f4c
commit
f78fcebe30
4 changed files with 16 additions and 4 deletions
13
Cargo.lock
generated
13
Cargo.lock
generated
|
|
@ -2455,7 +2455,7 @@ name = "iced_highlighter"
|
||||||
version = "0.14.0-dev"
|
version = "0.14.0-dev"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"syntect",
|
"two-face",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -6216,6 +6216,17 @@ dependencies = [
|
||||||
"utf-8",
|
"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]]
|
[[package]]
|
||||||
name = "typenum"
|
name = "typenum"
|
||||||
version = "1.19.0"
|
version = "1.19.0"
|
||||||
|
|
|
||||||
|
|
@ -221,12 +221,12 @@ sipper = "0.1"
|
||||||
smol = "2"
|
smol = "2"
|
||||||
smol_str = "0.2"
|
smol_str = "0.2"
|
||||||
softbuffer = { version = "0.4", default-features = false }
|
softbuffer = { version = "0.4", default-features = false }
|
||||||
syntect = { version = "5", default-features = false, features = ["default-fancy"] }
|
|
||||||
sysinfo = "0.33"
|
sysinfo = "0.33"
|
||||||
thiserror = "2"
|
thiserror = "2"
|
||||||
tiny-skia = { version = "0.11", default-features = false, features = ["std", "simd"] }
|
tiny-skia = { version = "0.11", default-features = false, features = ["std", "simd"] }
|
||||||
tokio = "1.0"
|
tokio = "1.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
|
two-face = { version = "0.4", default-features = false, features = ["syntect-default-fancy"] }
|
||||||
unicode-segmentation = "1.0"
|
unicode-segmentation = "1.0"
|
||||||
url = "2.5"
|
url = "2.5"
|
||||||
wasm-bindgen-futures = "0.4"
|
wasm-bindgen-futures = "0.4"
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,4 @@ workspace = true
|
||||||
[dependencies]
|
[dependencies]
|
||||||
iced_core.workspace = true
|
iced_core.workspace = true
|
||||||
|
|
||||||
syntect.workspace = true
|
two-face.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,10 @@ use std::sync::LazyLock;
|
||||||
|
|
||||||
use syntect::highlighting;
|
use syntect::highlighting;
|
||||||
use syntect::parsing;
|
use syntect::parsing;
|
||||||
|
use two_face::re_exports::syntect;
|
||||||
|
|
||||||
static SYNTAXES: LazyLock<parsing::SyntaxSet> =
|
static SYNTAXES: LazyLock<parsing::SyntaxSet> =
|
||||||
LazyLock::new(parsing::SyntaxSet::load_defaults_nonewlines);
|
LazyLock::new(two_face::syntax::extra_no_newlines);
|
||||||
|
|
||||||
static THEMES: LazyLock<highlighting::ThemeSet> =
|
static THEMES: LazyLock<highlighting::ThemeSet> =
|
||||||
LazyLock::new(highlighting::ThemeSet::load_defaults);
|
LazyLock::new(highlighting::ThemeSet::load_defaults);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue