From f8a2176ed12c1b2943e7fe5d19e4713da52f30d9 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 23 Oct 2020 16:35:01 +0300 Subject: [PATCH] rc markdown: Highlight inline code blocks properly This commit allows code blocks to be prefixed with tabulation characters to be picked up and highlighted by the editor. Indenting caused by the inclusion of an inline code block into a list item is also taken into account. However, that might cause false positives, for example with a hard wrapped list item indented with an amount of spaces congruent to 4. --- rc/filetype/markdown.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index fb504f2a..68aabd5a 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -82,7 +82,7 @@ add-highlighter shared/markdown/inline/text/ regex ^\h*(>\h*)+ 0:comment add-highlighter shared/markdown/inline/text/ regex "\H( {2,})$" 1:+r@meta # Inline code -add-highlighter shared/markdown/inline/text/ regex "^ [^\n]*" 0:meta +add-highlighter shared/markdown/inline/text/ regex "^( {4}|\t)+([^\n]+)" 2:meta # Commands # ‾‾‾‾‾‾‾‾