X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c4773a9b8e0ac823009bb342b2642f780de33cdc..f7a406c6a57bdaecae21ffc756cc07463118f5b6:/after/ftplugin/markdown.vim diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim index f6bfe47..13f93ed 100644 --- a/after/ftplugin/markdown.vim +++ b/after/ftplugin/markdown.vim @@ -67,13 +67,16 @@ else return '>1' elseif l2 =~ '^--\+\s*' && !s:is_mkdCode(a:lnum+1) " next line is underlined (level 2) - return '>2' + if g:vim_markdown_folding_level == 2 + return '>1' + else + return '>2' + endif endif let l1 = getline(a:lnum) if l1 =~ '^#' && !s:is_mkdCode(a:lnum) " fold level according to option - " (in vim -1 is visible, >= 0 is folded) let l:level = matchend(l1, '^#\+') if g:vim_markdown_folding_level == 1 || l:level > g:vim_markdown_folding_level return -1 @@ -91,7 +94,7 @@ else " current line starts with hashes return '>'.matchend(l0, '^#\+') else - " keep previous foldlevel + " fold here because of setext headers return '=' endif endfunction