[vim/vim] runtime/syntax/rmd.vim: code blocks mishighlighted (Issue #21328)

1 view
Skip to first unread message

Ivan Krasilnikov

unread,
Sep 16, 2026, 9:55:43 PM (2 days ago) Sep 16
to vim/vim, Subscribed
ivankra created an issue (vim/vim#21328)

Steps to reproduce

.qmd or .Rmd file with a non-executable code block:

text

```sh
code
```

text

Expected behaviour

Highlighting breaks at the code block's terminating ```

Version of Vim

9.2.1116

Environment

all

Logs and stack traces


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21328@github.com>

Ivan Krasilnikov

unread,
Sep 16, 2026, 10:02:13 PM (2 days ago) Sep 16
to vim/vim, Subscribed
ivankra left a comment (vim/vim#21328)

There's a typo at rmd.vim:137 - missing escape in .+.

I also suggest fixing the regexp for end= there to highlight code blocks with an indent (e.g. in lists)

Patch:

--- a/runtime/syntax/rmd.vim
+++ b/runtime/syntax/rmd.vim
@@ -134,7 +134,7 @@ endif
 " Step_3: Highlight code blocks.
 
 syn region rmdCodeBlock matchgroup=rmdCodeDelim start="^\s*```\s*{.*}$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend
-syn region rmdCodeBlock matchgroup=rmdCodeDelim start="^\s*```.+$" matchgroup=rmdCodeDelim end="^```$" keepend
+syn region rmdCodeBlock matchgroup=rmdCodeDelim start="^\s*```.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend
 hi link rmdCodeBlock Special
 
 " Now highlight chunks:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/21328/5707293857@github.com>

Reply all
Reply to author
Forward
0 new messages