diff --git a/runtime/syntax/pandoc.vim b/runtime/syntax/pandoc.vim index 7928cc665d..fdbdde096f 100644 --- a/runtime/syntax/pandoc.vim +++ b/runtime/syntax/pandoc.vim @@ -1,18 +1,23 @@ scriptencoding utf-8 -" +" Vim syntax file " Language: Pandoc (superset of Markdown) " Maintainer: Felipe Morales " Maintainer: Caleb Maclennan -" Upstream: https://github.com/vim-pandoc/vim-pandoc-syntax -" +" Upstream: https://github.com/vim-pandoc/vim-pandoc-syntax/tree/ea3fc415784bdcbae7f0093b80070ca4ff9e44c8 " Contributor: David Sanson " Jorge Israel Peña +" Christian Brabandt @chrisbra " Original Author: Jeremy Schultz " Version: 5.0 " Last Change: 2024 Apr 08 +" 2025 Jun 27 by Vim project: sync with upstream (#17598) -let s:cpo_save = &cpo -set cpo&vim +if exists('b:current_syntax') + finish +endif + +let s:cpo_save = &cpoptions +set cpoptions&vim " Configuration: {{{1 " @@ -155,10 +160,10 @@ endif " Functions: {{{1 " EnableEmbedsforCodeblocksWithLang {{{2 function! EnableEmbedsforCodeblocksWithLang(entry) - " prevent embedded language syntaxes from changing 'foldmethod' + " prevent embedded language syntaxes from changing 'foldmethod' if has('folding') let s:foldmethod = &l:foldmethod - let s:foldtext = &l:foldtext + let s:foldtext = &l:foldtext endif try @@ -169,7 +174,7 @@ function! EnableEmbedsforCodeblocksWithLang(entry) " We might have just turned off spellchecking by including the file, " so we turn it back on here. exe 'syntax spell toplevel' - exe 'syn region pandocDelimitedCodeBlock_' . s:langname . ' start=/\(\_^\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>.*\n\)\@<=\_^/' . + exe 'syn region pandocDelimitedCodeBlock_' . s:langname . ' start=/\(\_^\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*[.=]\)\=' . s:langname . '\>.*\n\)\@<=\_^/' . \' end=/\_$\n\(\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' . \' contains=@' . toupper(s:langname) exe 'syn region pandocDelimitedCodeBlockinBlockQuote_' . s:langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>/' . @@ -228,7 +233,7 @@ syntax spell toplevel " Embeds: {{{2 -" prevent embedded language syntaxes from changing 'foldmethod' +" prevent embedded language syntaxes from changing 'foldmethod' if has('folding') let s:foldmethod = &l:foldmethod endif @@ -295,7 +300,7 @@ syn region pandocCodeBlockInsideIndent start=/\(\(\d\|\a\|*\).*\n\)\@\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pa call s:WithConceal('list', 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem', 'conceal cchar='.s:cchars['li']) " Ordered lists -syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display +syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocReferenceURL,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display " support for roman numerals up to 'c' if g:pandoc#syntax#roman_lists != 0 @@ -501,8 +506,8 @@ syn match pandocListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@