From e8986b1e59e60fa97349754b160dd68a34ab2093 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 25 Sep 2023 17:48:22 +0200 Subject: [PATCH] egui_extras: syntax-highlighting of .toml (#3388) --- crates/egui_extras/src/syntax_highlighting.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/egui_extras/src/syntax_highlighting.rs b/crates/egui_extras/src/syntax_highlighting.rs index 1bb81d13..775d7207 100644 --- a/crates/egui_extras/src/syntax_highlighting.rs +++ b/crates/egui_extras/src/syntax_highlighting.rs @@ -508,6 +508,7 @@ impl Language { "c" | "h" | "hpp" | "cpp" | "c++" => Some(Self::cpp()), "py" | "python" => Some(Self::python()), "rs" | "rust" => Some(Self::rust()), + "toml" => Some(Self::toml()), _ => { None // unsupported language } @@ -655,4 +656,12 @@ impl Language { .collect(), } } + + fn toml() -> Self { + Self { + double_slash_comments: false, + hash_comments: true, + keywords: Default::default(), + } + } }