aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-03-14 18:46:10 +0800
committerChristian Clason <c.clason@uni-graz.at>2024-03-14 18:54:22 +0800
commit3ae78f376c2e721ce4feb23e9a5e8bc6062a2657 (patch)
tree9ef278309379054f36e85a87107bef601219939d
parentbot(lockfile): update angular, awk, heex, html, kotlin, markdown, markdown_in... (diff)
downloadnvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.tar
nvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.tar.gz
nvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.tar.bz2
nvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.tar.lz
nvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.tar.xz
nvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.tar.zst
nvim-treesitter-3ae78f376c2e721ce4feb23e9a5e8bc6062a2657.zip
fix(vimdoc): adapt to breaking Neovim change
Problem: https://github.com/neovim/neovim/commit/cb46f6e467268edf917cc3617b4c024a66b256de#diff-edf997b0c2d42d31828800641ac1f5a46487fe24a0d46ccf70bcd58a14f3868f introduced a regression on how `#set!` behaves with several matches in a single pattern, breaking conceals in, e.g., taglinks. Solution: Separate taglink etc. patterns into concealed marker and contents. Also add URL support for concealed markdown links.
-rw-r--r--queries/markdown_inline/highlights.scm5
-rw-r--r--queries/vimdoc/highlights.scm12
2 files changed, 14 insertions, 3 deletions
diff --git a/queries/markdown_inline/highlights.scm b/queries/markdown_inline/highlights.scm
index cae8acfb4..e38ef3d7b 100644
--- a/queries/markdown_inline/highlights.scm
+++ b/queries/markdown_inline/highlights.scm
@@ -33,6 +33,11 @@
] @markup.link
(#set! conceal ""))
+(inline_link
+ (link_text) @markup.link.label
+ (link_destination) @markup.link
+ (#set! @markup.link.label "url" @markup.link))
+
; Conceal image links
(image
[
diff --git a/queries/vimdoc/highlights.scm b/queries/vimdoc/highlights.scm
index a1c14f02e..70a3a2f20 100644
--- a/queries/vimdoc/highlights.scm
+++ b/queries/vimdoc/highlights.scm
@@ -12,12 +12,16 @@
(tag
"*" @label
- (#set! conceal "")
+ (#set! conceal ""))
+
+(tag
text: (_) @label)
(taglink
"|" @markup.link
- (#set! conceal "")
+ (#set! conceal ""))
+
+(taglink
text: (_) @markup.link)
(optionlink
@@ -25,7 +29,9 @@
(codespan
"`" @markup.raw
- (#set! conceal "")
+ (#set! conceal ""))
+
+(codespan
text: (_) @markup.raw)
((codeblock) @markup.raw.block