X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c4773a9b8e0ac823009bb342b2642f780de33cdc..3827a2680a7205ff3da78a18531d39463c637ebc:/after/ftplugin/markdown.vim diff --git a/after/ftplugin/markdown.vim b/after/ftplugin/markdown.vim index f6bfe47..1916a73 100644 --- a/after/ftplugin/markdown.vim +++ b/after/ftplugin/markdown.vim @@ -64,16 +64,19 @@ else let l2 = getline(a:lnum+1) if l2 =~ '^==\+\s*' && !s:is_mkdCode(a:lnum+1) " next line is underlined (level 1) - return '>1' + return 0 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 0 + else + return 1 + 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,8 +94,8 @@ else " current line starts with hashes return '>'.matchend(l0, '^#\+') else - " keep previous foldlevel - return '=' + " fold here because of setext headers + return 1 endif endfunction endif