Skip to content

Commit c031a3e

Browse files
tomtomjhjalerque
andauthored
Avoid trailing comments --> turning the comment into a heading (#517)
Co-authored-by: Caleb Maclennan <[email protected]>
1 parent 95e9084 commit c031a3e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

after/ftplugin/markdown.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ if get(g:, 'vim_markdown_folding_style_pythonic', 0)
6262
" next line is underlined (level 1)
6363
return '>0'
6464
" else, if the nex line starts with two or more '-'
65+
" but is not comment closer (-->)
6566
" and is not code
66-
elseif l2 =~# '^--\+\s*' && !s:is_mkdCode(a:lnum+1)
67+
elseif l2 =~# '^--\+\s*$' && !s:is_mkdCode(a:lnum+1)
6768
" next line is underlined (level 2)
6869
return '>1'
6970
endif
@@ -131,7 +132,7 @@ else " vim_markdown_folding_style_pythonic == 0
131132
if l2 =~# '^==\+\s*' && !s:is_mkdCode(a:lnum+1)
132133
" next line is underlined (level 1)
133134
return '>1'
134-
elseif l2 =~# '^--\+\s*' && !s:is_mkdCode(a:lnum+1)
135+
elseif l2 =~# '^--\+\s*$' && !s:is_mkdCode(a:lnum+1)
135136
" next line is underlined (level 2)
136137
if s:vim_markdown_folding_level >= 2
137138
return '>1'

0 commit comments

Comments
 (0)