From 917624e16c47de87c2adcacd08bc9472f718ec12 Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Sat, 9 Jan 2016 14:08:09 +0900 Subject: [PATCH] Fix indent code block and add tests `mkdIndentCode` is renamed to `mkdCode` because there is no need to distinguish them. We fixed a bug that indent code block at the start of a file is not highlighted. --- syntax/markdown.vim | 7 +++---- test/syntax.vader | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index fc036c6..035199b 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -79,9 +79,9 @@ syn region mkdCode start="]*>" end="" syn region mkdCode start="]*>" end="" syn region mkdFootnote start="\[^" end="\]" syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ -syn match mkdIndentCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained +syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained syn region mkdListItemLine matchgroup=mkdListItem start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" contains=@mkdNonListItem,@Spell -syn region mkdNonListItemBlock start="\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell +syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ @@ -110,12 +110,11 @@ if get(g:, 'vim_markdown_math', 0) syn region mkdMath matchgroup=mkdDelimiter start="\\\@