From 36bebb6d159c6a12ba99df3c3d3682d83972ec52 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Thu, 8 Aug 2024 19:02:28 +0100 Subject: [PATCH] add markup syntax color for markdown --- CHANGELOG.md | 1 + defaults/dark-theme.toml | 8 ++++++++ defaults/light-theme.toml | 8 ++++++++ lapce-core/src/language.rs | 4 ++-- lapce-core/src/style.rs | 8 ++++++++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbfcb805..07da85be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features/Changes ### Bug Fixes +- Fix markdown syntax highlighting ## 0.4.1 diff --git a/defaults/dark-theme.toml b/defaults/dark-theme.toml index 478d501a..8d3c6ce0 100644 --- a/defaults/dark-theme.toml +++ b/defaults/dark-theme.toml @@ -68,6 +68,14 @@ dim-text = "#5C6370" "variable.other.member" = "$red" "tag" = "$blue" +"markup.heading" = "$red" +"markup.bold" = "$orange" +"markup.italic" = "$orange" +"markup.list" = "$orange" +"markup.link.url" = "$blue" +"markup.link.label" = "$purple" +"markup.link.text" = "$purple" + "bracket.color.1" = "$blue" "bracket.color.2" = "$yellow" "bracket.color.3" = "$purple" diff --git a/defaults/light-theme.toml b/defaults/light-theme.toml index 5cef4861..570e6f75 100644 --- a/defaults/light-theme.toml +++ b/defaults/light-theme.toml @@ -74,6 +74,14 @@ dim-text = "#A0A1A7" "variable.other.member" = "$red" "tag" = "$blue" +"markup.heading" = "$red" +"markup.bold" = "$orange" +"markup.italic" = "$orange" +"markup.list" = "$orange" +"markup.link.url" = "$blue" +"markup.link.label" = "$purple" +"markup.link.text" = "$purple" + "bracket.color.1" = "$blue" "bracket.color.2" = "$yellow" "bracket.color.3" = "$purple" diff --git a/lapce-core/src/language.rs b/lapce-core/src/language.rs index 53c9ae49..15c1535a 100644 --- a/lapce-core/src/language.rs +++ b/lapce-core/src/language.rs @@ -1169,8 +1169,8 @@ pub enum LapceLanguage { extensions: &[], comment: comment_properties!(), tree_sitter: TreeSitterProperties { - grammar: Some("markdown"), - grammar_fn: None, + grammar: Some("markdown_inline"), + grammar_fn: Some("markdown_inline"), query: Some("markdown.inline"), code_glance: (DEFAULT_CODE_GLANCE_LIST, DEFAULT_CODE_GLANCE_IGNORE_LIST), sticky_headers: &[], diff --git a/lapce-core/src/style.rs b/lapce-core/src/style.rs index fed66424..9f6a5cd2 100644 --- a/lapce-core/src/style.rs +++ b/lapce-core/src/style.rs @@ -33,6 +33,14 @@ "conceal", "none", "tag", + "markup.bold", + "markup.italic", + "markup.list", + "markup.quote", + "markup.heading", + "markup.link.url", + "markup.link.label", + "markup.link.text", ]; pub fn line_styles(