vim:syn:md: Use lookarounds instead of \zs & \ze
Apparently the `\zs` token does not match characters if they are already part of a syntax match. For example in `[^0][^1]` only the zero footnote is matched. Fix this by using a positive lookbehind that does not have this limitation. Additionally, use a negative lookahead for the colon to make the pattern slightly more readable, since it does not need the end-of-line check.
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
" Either not at the start of the line, or otherwise not followed by a colon
|
" Either not at the start of the line, or otherwise not followed by a colon
|
||||||
syntax match markdownFootnoteZero /\v(.\zs\[\^0\])|(^\[\^0\]\ze([^:]|$))/ conceal cchar=⁰
|
syntax match markdownFootnoteZero /\v(.@1<=\[\^0\])|(^\[\^0\]:@!)/ conceal cchar=⁰
|
||||||
syntax match markdownFootnoteOne /\v(.\zs\[\^1\])|(^\[\^1\]\ze([^:]|$))/ conceal cchar=¹
|
syntax match markdownFootnoteOne /\v(.@1<=\[\^1\])|(^\[\^1\]:@!)/ conceal cchar=¹
|
||||||
syntax match markdownFootnoteTwo /\v(.\zs\[\^2\])|(^\[\^2\]\ze([^:]|$))/ conceal cchar=²
|
syntax match markdownFootnoteTwo /\v(.@1<=\[\^2\])|(^\[\^2\]:@!)/ conceal cchar=²
|
||||||
syntax match markdownFootnoteThree /\v(.\zs\[\^3\])|(^\[\^3\]\ze([^:]|$))/ conceal cchar=³
|
syntax match markdownFootnoteThree /\v(.@1<=\[\^3\])|(^\[\^3\]:@!)/ conceal cchar=³
|
||||||
syntax match markdownFootnoteFour /\v(.\zs\[\^4\])|(^\[\^4\]\ze([^:]|$))/ conceal cchar=⁴
|
syntax match markdownFootnoteFour /\v(.@1<=\[\^4\])|(^\[\^4\]:@!)/ conceal cchar=⁴
|
||||||
syntax match markdownFootnoteFive /\v(.\zs\[\^5\])|(^\[\^5\]\ze([^:]|$))/ conceal cchar=⁵
|
syntax match markdownFootnoteFive /\v(.@1<=\[\^5\])|(^\[\^5\]:@!)/ conceal cchar=⁵
|
||||||
syntax match markdownFootnoteSix /\v(.\zs\[\^6\])|(^\[\^6\]\ze([^:]|$))/ conceal cchar=⁶
|
syntax match markdownFootnoteSix /\v(.@1<=\[\^6\])|(^\[\^6\]:@!)/ conceal cchar=⁶
|
||||||
syntax match markdownFootnoteSeven /\v(.\zs\[\^7\])|(^\[\^7\]\ze([^:]|$))/ conceal cchar=⁷
|
syntax match markdownFootnoteSeven /\v(.@1<=\[\^7\])|(^\[\^7\]:@!)/ conceal cchar=⁷
|
||||||
syntax match markdownFootnoteEight /\v(.\zs\[\^8\])|(^\[\^8\]\ze([^:]|$))/ conceal cchar=⁸
|
syntax match markdownFootnoteEight /\v(.@1<=\[\^8\])|(^\[\^8\]:@!)/ conceal cchar=⁸
|
||||||
syntax match markdownFootnoteNine /\v(.\zs\[\^9\])|(^\[\^9\]\ze([^:]|$))/ conceal cchar=⁹
|
syntax match markdownFootnoteNine /\v(.@1<=\[\^9\])|(^\[\^9\]:@!)/ conceal cchar=⁹
|
||||||
|
|||||||
Reference in New Issue
Block a user