summaryrefslogtreecommitdiffstats
path: root/syntax/markdown.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-01-28 18:07:33 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2016-01-28 18:07:33 +0100
commitb4a6290b42701b09069e052d1c3c1aa904752254 (patch)
tree5346b7db38c0c93ccbb338a96ede53522ff114f3 /syntax/markdown.vim
parentc324a086b2e184f0275c46e97acbf95376683fde (diff)
downloadvim-polyglot-b4a6290b42701b09069e052d1c3c1aa904752254.tar.gz
vim-polyglot-b4a6290b42701b09069e052d1c3c1aa904752254.zip
Update
Diffstat (limited to 'syntax/markdown.vim')
-rw-r--r--syntax/markdown.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/syntax/markdown.vim b/syntax/markdown.vim
index 9df4a7e5..5eaa1831 100644
--- a/syntax/markdown.vim
+++ b/syntax/markdown.vim
@@ -20,14 +20,20 @@ unlet! b:current_syntax
if !exists('g:markdown_fenced_languages')
let g:markdown_fenced_languages = []
endif
+let s:done_include = {}
for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
+ if has_key(s:done_include, matchstr(s:type,'[^.]*'))
+ continue
+ endif
if s:type =~ '\.'
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
endif
exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
unlet! b:current_syntax
+ let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor
unlet! s:type
+unlet! s:done_include
syn sync minlines=10
syn case ignore
@@ -93,10 +99,16 @@ syn match markdownFootnote "\[^[^\]]\+\]"
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
if main_syntax ==# 'markdown'
+ let s:done_include = {}
for s:type in g:markdown_fenced_languages
+ if has_key(s:done_include, matchstr(s:type,'[^.]*'))
+ continue
+ endif
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```*\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
+ let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor
unlet! s:type
+ unlet! s:done_include
endif
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"