fix(vimdoc): adapt to breaking Neovim change

Problem:
cb46f6e467 (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.
This commit is contained in:
Christian Clason 2024-03-14 18:46:10 +08:00
parent 497fe685ff
commit 3ae78f376c
2 changed files with 14 additions and 3 deletions

View file

@ -33,6 +33,11 @@
] @markup.link ] @markup.link
(#set! conceal "")) (#set! conceal ""))
(inline_link
(link_text) @markup.link.label
(link_destination) @markup.link
(#set! @markup.link.label "url" @markup.link))
; Conceal image links ; Conceal image links
(image (image
[ [

View file

@ -12,12 +12,16 @@
(tag (tag
"*" @label "*" @label
(#set! conceal "") (#set! conceal ""))
(tag
text: (_) @label) text: (_) @label)
(taglink (taglink
"|" @markup.link "|" @markup.link
(#set! conceal "") (#set! conceal ""))
(taglink
text: (_) @markup.link) text: (_) @markup.link)
(optionlink (optionlink
@ -25,7 +29,9 @@
(codespan (codespan
"`" @markup.raw "`" @markup.raw
(#set! conceal "") (#set! conceal ""))
(codespan
text: (_) @markup.raw) text: (_) @markup.raw)
((codeblock) @markup.raw.block ((codeblock) @markup.raw.block