From 199dc05a044a427a45b2654beb4bf65841c9ce5b Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+nik-rev@users.noreply.github.com> Date: Mon, 10 Feb 2025 20:58:39 +0000 Subject: [PATCH] fix: Align `Markdown` styles with tree sitter highlights (#12696) Co-authored-by: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> --- helix-term/src/ui/markdown.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index 96614443f..fe581b5ad 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -132,6 +132,9 @@ pub struct Markdown { impl Markdown { const TEXT_STYLE: &'static str = "ui.text"; const BLOCK_STYLE: &'static str = "markup.raw.inline"; + const RULE_STYLE: &'static str = "punctuation.special"; + const UNNUMBERED_LIST_STYLE: &'static str = "markup.list.unnumbered"; + const NUMBERED_LIST_STYLE: &'static str = "markup.list.numbered"; const HEADING_STYLES: [&'static str; 6] = [ "markup.heading.1", "markup.heading.2", @@ -178,6 +181,9 @@ impl Markdown { let get_theme = |key: &str| -> Style { theme.map(|t| t.get(key)).unwrap_or_default() }; let text_style = get_theme(Self::TEXT_STYLE); let code_style = get_theme(Self::BLOCK_STYLE); + let numbered_list_style = get_theme(Self::NUMBERED_LIST_STYLE); + let unnumbered_list_style = get_theme(Self::UNNUMBERED_LIST_STYLE); + let rule_style = get_theme(Self::RULE_STYLE); let heading_styles: Vec