From cf296ed9c5ddf01b66b26a2f10f77998f44640d9 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Sun, 16 Jan 2022 02:13:11 +0800 Subject: [PATCH] config: Don't skip extra syntax loading if highlight_theme = css (#1732) Currently, init_extra_syntaxtes_and_highlight_themes will supress loading anything if highlight_theme is "css". This makes sense for the highlight themes, but will also skip loading any extra syntax definitions too. This change defers the theme = css check, so we still load syntaxes in this case. Fixes: #1723 Signed-off-by: Jeremy Kerr --- components/config/src/config/markup.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/config/src/config/markup.rs b/components/config/src/config/markup.rs index 57894f2376..2b250cdab6 100644 --- a/components/config/src/config/markup.rs +++ b/components/config/src/config/markup.rs @@ -107,16 +107,17 @@ impl Markdown { } pub fn init_extra_syntaxes_and_highlight_themes(&mut self, path: &Path) -> Result<()> { - if self.highlight_theme == "css" { - return Ok(()); - } - let (loaded_extra_syntaxes, loaded_extra_highlight_themes) = self.load_extra_syntaxes_and_highlight_themes(path)?; if let Some(extra_syntax_set) = loaded_extra_syntaxes { self.extra_syntax_set = Some(extra_syntax_set); } + + if self.highlight_theme == "css" { + return Ok(()); + } + if let Some(extra_theme_set) = loaded_extra_highlight_themes { self.extra_theme_set = Arc::new(Some(extra_theme_set)); }