summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Felice <jason.m.felice@gmail.com>2025-03-31 19:09:46 -0400
committerJason Felice <jason.m.felice@gmail.com>2025-03-31 19:30:06 -0400
commita75c693cf1eb1b51862411a70475c2e84abc42a8 (patch)
tree040cca2a9c186ee583663183732b1d8823c4751e
parentc7d688f578c7b58989fc04e7bb1e9b5a939a5730 (diff)
Handle Rmd
-rw-r--r--rc/filetype/markdown.kak4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak
index b5159099..0a08bdc9 100644
--- a/rc/filetype/markdown.kak
+++ b/rc/filetype/markdown.kak
@@ -4,7 +4,7 @@
# Detection
# ‾‾‾‾‾‾‾‾‾
-hook global BufCreate .*[.](markdown|md|mkd) %{
+hook global BufCreate .*[.](markdown|md|mkd|Rmd) %{
set-option buffer filetype markdown
}
@@ -96,7 +96,7 @@ define-command markdown-load-languages -params 1 %{
execute-keys "%arg{1}1s```\h*\{?[.=]?(\w+)\}?<ret>"
evaluate-commands -itersel %{ try %{
require-module %val{selection}
- add-highlighter "shared/markdown/codeblock/%val{selection}" region -match-capture "^(\h*)```\h*(%val{selection}\b|\{[.=]?%val{selection}\})" ^(\h*)``` regions
+ add-highlighter "shared/markdown/codeblock/%val{selection}" region -match-capture "^(\h*)```\h*(%val{selection}\b|\{[.=]?%val{selection}(?:[\h,][^\{\}]*)?\})" ^(\h*)``` regions
add-highlighter "shared/markdown/codeblock/%val{selection}/" default-region fill meta
add-highlighter "shared/markdown/codeblock/%val{selection}/inner" region \A\h*```[^\n]*\K (?=```) ref %val{selection}
add-highlighter "shared/markdown/listblock/codeblock/%val{selection}" region -match-capture "^(\h*)```\h*(%val{selection}\b|\{[.=]?%val{selection}\})" ^(\h*)``` regions