All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 let g:vim_markdown_folding_style_pythonic = 1
3 source ../after/ftplugin/markdown.vim
7 setlocal foldmethod=manual
16 # This is just a comment
23 Execute (fold level # in code block):
24 AssertEqual foldlevel(1), 1, '# Title'
25 AssertEqual foldlevel(3), 2, '## Chapter 1'
26 AssertEqual foldlevel(7), 2, '# This is just a comment'
27 AssertEqual foldlevel(8), 2, '```'
28 AssertEqual foldlevel(10), 2, '## Chapter 2'
29 AssertEqual foldlevel(12), 2, 'foobar'
31 Execute (fold text of chapters):
32 let b:width = winwidth(0)
33 let b:hyphen = repeat('-', b:width - 18 > 2 ? b:width - 18 : b:width - 9 > 0 ? 3 : 2)
34 AssertEqual foldtextresult(10), strpart('## Chapter 2', 0, b:width - 9) . ' ' . b:hyphen . ' 2'
42 Execute (fold level ==, --):
43 AssertEqual foldlevel(2), 0, '=='
44 AssertEqual foldlevel(4), 1, '--'
46 Execute (fold text of ==, --):
47 let b:width = winwidth(0)
48 let b:hyphen = repeat('-', b:width - 17 > 2 ? b:width - 17 : b:width - 9 > 0 ? 3 : 2)
49 AssertEqual foldtextresult(3), strpart('Fold text 2', 0, b:width - 9) . ' ' . b:hyphen . ' 1'
58 Execute (fold any preamble):
59 AssertEqual foldlevel(1), 1, 'Headline'
60 AssertEqual foldlevel(3), 1, 'foobar'
61 AssertEqual foldlevel(5), 1, '# Title'
66 title: A test of the heading folding when there is YAML frontmatter
67 tags: markdown yaml vim-markdown
74 Execute (fold level of yaml front matter):
75 let g:vim_markdown_frontmatter = 1
76 source ../after/ftplugin/markdown.vim
77 AssertEqual foldlevel(1), 1, '---'
78 AssertEqual foldlevel(2), 1, 'layout: article'
79 AssertEqual foldlevel(4), 1, 'tags: markdown yaml vim-markdown'
80 AssertEqual foldlevel(5), 1, '---'
81 AssertEqual foldlevel(6), 1, 'body'
82 AssertEqual foldlevel(8), 1, 'heading'
83 AssertEqual foldlevel(9), 1, '-------'
84 unlet g:vim_markdown_frontmatter