1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 23:00:04 -04:00

Add syntax highlighing feature to egui_extras (#3333)

* Add syntax highlighing feature to egui_extras

Enable "syntect" feature for great syntax highlighting of any language.

If not a simple fallback is used that works fine for C++, Rust, Python

* Check --no-default-features of egui_extras on CI

* spelling

* Fix building egui_extras without additional features
This commit is contained in:
Emil Ernerfeldt
2023-09-13 20:39:40 +02:00
committed by GitHub
parent 4b5146d35d
commit 5e785ae00a
15 changed files with 307 additions and 98 deletions

View File

@@ -49,9 +49,13 @@ puffin = ["dep:puffin", "egui/puffin"]
## Support loading svg images.
svg = ["resvg", "tiny-skia", "usvg"]
## Enable better syntax highlighting using [`syntect`](https://docs.rs/syntect).
syntect = ["dep:syntect"]
[dependencies]
egui = { version = "0.22.0", path = "../egui", default-features = false }
enum-map = { version = "2", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
#! ### Optional dependencies
@@ -83,6 +87,10 @@ mime_guess = { version = "2.0.4", optional = true, default-features = false }
puffin = { version = "0.16", optional = true }
syntect = { version = "5", optional = true, default-features = false, features = [
"default-fancy",
] }
# svg feature
resvg = { version = "0.28", optional = true, default-features = false }
tiny-skia = { version = "0.8", optional = true, default-features = false } # must be updated in lock-step with resvg