Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply upstream fixes #393

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 102 additions & 102 deletions syntax/pandoc.vim
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
scriptencoding utf-8
" vim: set fdm=marker foldlevel=0:
"

" Vim syntax file
" Language: Pandoc (superset of Markdown)
" Maintainer: Felipe Morales <[email protected]>
" Maintainer: Caleb Maclennan <[email protected]>
"
" Language: Pandoc (superset of Markdown)
" Maintainer: Felipe Morales <[email protected]>
" Maintainer: Caleb Maclennan <[email protected]>
" Contributor: David Sanson <[email protected]>
" Contributor: Jorge Israel Peña <[email protected]>
" OriginalAuthor: Jeremy Schultz <[email protected]>
" Contributor: David Sanson <[email protected]>
" Jorge Israel Peña <[email protected]>
" Christian Brabandt @chrisbra
" Original Author: Jeremy Schultz <[email protected]>
" Version: 5.0
" Last Change: 2024 Apr 08

let s:cpo_save = &cpo
set cpo&vim

" Configuration: {{{1
"
" use conceal? {{{2
if !exists('g:pandoc#syntax#conceal#use')
if v:version < 703
let g:pandoc#syntax#conceal#use = 0
else
let g:pandoc#syntax#conceal#use = 1
endif
else
" exists, but we cannot use it, disable anyway
if v:version < 703
let g:pandoc#syntax#conceal#use = 0
endif
let g:pandoc#syntax#conceal#use = 1
endif
"}}}2

Expand Down Expand Up @@ -228,6 +223,7 @@ command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsf
" BASE:
syntax clear
syntax spell toplevel

" apply extra settings: {{{1
if g:pandoc#syntax#colorcolumn == 1
exe 'setlocal colorcolumn='.string(&textwidth+5)
Expand Down Expand Up @@ -583,94 +579,94 @@ syn region pandocYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/
" Styling: {{{1
function! s:SetupPandocHighlights()

hi link pandocOperator Operator
hi def link pandocOperator Operator

" override this for consistency
hi pandocTitleBlock term=italic gui=italic
hi link pandocTitleBlockTitle Directory
hi link pandocAtxHeader Title
hi link pandocAtxStart Operator
hi link pandocSetexHeader Title
hi link pandocHeaderAttr Comment
hi link pandocHeaderID Identifier

hi link pandocLaTexSectionCmd texSection
hi link pandocLaTeXDelimiter texDelimiter

hi link pandocHTMLComment Comment
hi link pandocHTMLCommentStart Delimiter
hi link pandocHTMLCommentEnd Delimiter
hi link pandocBlockQuote Comment
hi link pandocBlockQuoteMark Comment
hi link pandocAmpersandEscape Special
hi def link pandocTitleBlockTitle Directory
hi def link pandocAtxHeader Title
hi def link pandocAtxStart Operator
hi def link pandocSetexHeader Title
hi def link pandocHeaderAttr Comment
hi def link pandocHeaderID Identifier

hi def link pandocLaTexSectionCmd texSection
hi def link pandocLaTeXDelimiter texDelimiter

hi def link pandocHTMLComment Comment
hi def link pandocHTMLCommentStart Delimiter
hi def link pandocHTMLCommentEnd Delimiter
hi def link pandocBlockQuote Comment
hi def link pandocBlockQuoteMark Comment
hi def link pandocAmpersandEscape Special

" if the user sets g:pandoc#syntax#codeblocks#ignore to contain
" a codeblock type, don't highlight it so that it remains Normal
if index(g:pandoc#syntax#codeblocks#ignore, 'definition') == -1
hi link pandocCodeBlockInsideIndent String
hi def link pandocCodeBlockInsideIndent String
endif

if index(g:pandoc#syntax#codeblocks#ignore, 'delimited') == -1
hi link pandocDelimitedCodeBlock Special
hi def link pandocDelimitedCodeBlock Special
endif

hi link pandocDelimitedCodeBlockStart Delimiter
hi link pandocDelimitedCodeBlockEnd Delimiter
hi link pandocDelimitedCodeBlockLanguage Comment
hi link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote
hi link pandocCodePre String

hi link pandocLineBlockDelimiter Delimiter

hi link pandocListItemBullet Operator
hi link pandocUListItemBullet Operator
hi link pandocListItemBulletId Identifier

hi link pandocReferenceLabel Label
hi link pandocReferenceURL Underlined
hi link pandocLinkTip Identifier
hi link pandocImageIcon Operator

hi link pandocReferenceDefinition Operator
hi link pandocReferenceDefinitionLabel Label
hi link pandocReferenceDefinitionAddress Underlined
hi link pandocReferenceDefinitionTip Identifier

hi link pandocAutomaticLink Underlined

hi link pandocDefinitionBlockTerm Identifier
hi link pandocDefinitionBlockMark Operator

hi link pandocSimpleTableDelims Delimiter
hi link pandocSimpleTableHeader pandocStrong
hi link pandocTableMultilineHeader pandocStrong
hi link pandocTableDelims Delimiter
hi link pandocGridTableDelims Delimiter
hi link pandocGridTableHeader Delimiter
hi link pandocPipeTableDelims Delimiter
hi link pandocPipeTableHeader Delimiter
hi link pandocTableHeaderWord pandocStrong

hi link pandocAbbreviationHead Type
hi link pandocAbbreviation Label
hi link pandocAbbreviationTail Type
hi link pandocAbbreviationSeparator Identifier
hi link pandocAbbreviationDefinition Comment

hi link pandocFootnoteID Label
hi link pandocFootnoteIDHead Type
hi link pandocFootnoteIDTail Type
hi link pandocFootnoteDef Comment
hi link pandocFootnoteDefHead Type
hi link pandocFootnoteDefTail Type
hi link pandocFootnoteBlock Comment
hi link pandocFootnoteBlockSeparator Operator

hi link pandocPCite Operator
hi link pandocICite Operator
hi link pandocCiteKey Label
hi link pandocCiteAnchor Operator
hi link pandocCiteLocator Operator
hi def link pandocDelimitedCodeBlockStart Delimiter
hi def link pandocDelimitedCodeBlockEnd Delimiter
hi def link pandocDelimitedCodeBlockLanguage Comment
hi def link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote
hi def link pandocCodePre String

hi def link pandocLineBlockDelimiter Delimiter

hi def link pandocListItemBullet Operator
hi def link pandocUListItemBullet Operator
hi def link pandocListItemBulletId Identifier

hi def link pandocReferenceLabel Label
hi def link pandocReferenceURL Underlined
hi def link pandocLinkTip Identifier
hi def link pandocImageIcon Operator

hi def link pandocReferenceDefinition Operator
hi def link pandocReferenceDefinitionLabel Label
hi def link pandocReferenceDefinitionAddress Underlined
hi def link pandocReferenceDefinitionTip Identifier

hi def link pandocAutomaticLink Underlined

hi def link pandocDefinitionBlockTerm Identifier
hi def link pandocDefinitionBlockMark Operator

hi def link pandocSimpleTableDelims Delimiter
hi def link pandocSimpleTableHeader pandocStrong
hi def link pandocTableMultilineHeader pandocStrong
hi def link pandocTableDelims Delimiter
hi def link pandocGridTableDelims Delimiter
hi def link pandocGridTableHeader Delimiter
hi def link pandocPipeTableDelims Delimiter
hi def link pandocPipeTableHeader Delimiter
hi def link pandocTableHeaderWord pandocStrong

hi def link pandocAbbreviationHead Type
hi def link pandocAbbreviation Label
hi def link pandocAbbreviationTail Type
hi def link pandocAbbreviationSeparator Identifier
hi def link pandocAbbreviationDefinition Comment

hi def link pandocFootnoteID Label
hi def link pandocFootnoteIDHead Type
hi def link pandocFootnoteIDTail Type
hi def link pandocFootnoteDef Comment
hi def link pandocFootnoteDefHead Type
hi def link pandocFootnoteDefTail Type
hi def link pandocFootnoteBlock Comment
hi def link pandocFootnoteBlockSeparator Operator

hi def link pandocPCite Operator
hi def link pandocICite Operator
hi def link pandocCiteKey Label
hi def link pandocCiteAnchor Operator
hi def link pandocCiteLocator Operator

if g:pandoc#syntax#style#emphases == 1
hi pandocEmphasis gui=italic cterm=italic
Expand All @@ -695,19 +691,18 @@ function! s:SetupPandocHighlights()
exe 'hi pandocNoFormattedInEmphasis gui=italic cterm=italic'.s:hi_tail
exe 'hi pandocNoFormattedInStrong gui=bold cterm=bold'.s:hi_tail
endif
hi link pandocNoFormatted String
hi link pandocNoFormattedAttrs Comment
hi link pandocSubscriptMark Operator
hi link pandocSuperscriptMark Operator
hi link pandocStrikeoutMark Operator
hi def link pandocNoFormatted String
hi def link pandocNoFormattedAttrs Comment
hi def link pandocSubscriptMark Operator
hi def link pandocSuperscriptMark Operator
hi def link pandocStrikeoutMark Operator
if g:pandoc#syntax#style#underline_special == 1
hi pandocSubscript gui=underline cterm=underline
hi pandocSuperscript gui=underline cterm=underline
hi pandocStrikeout gui=underline cterm=underline
endif
hi link pandocNewLine Error
hi link pandocHRule Delimiter

hi def link pandocNewLine Error
hi def link pandocHRule Delimiter
endfunction

" Whenever the colorscheme changes, all highlights are cleared.
Expand Down Expand Up @@ -745,3 +740,8 @@ let b:current_syntax = 'pandoc'

syntax sync clear
syntax sync minlines=1000

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: set fdm=marker foldlevel=0:
Loading