fix another round of fixes of M3

This commit is contained in:
2026-04-05 18:06:57 +02:00
parent cf20f19fc0
commit 95cacdcd0e
8 changed files with 318 additions and 172 deletions

View File

@@ -1,8 +1,17 @@
use std::collections::HashMap;
use std::sync::LazyLock;
use syntect::highlighting::{Style, ThemeSet};
use syntect::parsing::{SyntaxReference, SyntaxSet};
/// Global highlighter singleton (expensive to create, safe to share).
static GLOBAL_HIGHLIGHTER: LazyLock<Highlighter> = LazyLock::new(Highlighter::new);
/// Return a reference to the global syntax highlighter.
pub fn highlighter() -> &'static Highlighter {
&GLOBAL_HIGHLIGHTER
}
/// Syntax highlighter using syntect with line-level caching.
pub struct Highlighter {
syntax_set: SyntaxSet,