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.
1 " Tests atx and setext folding, and :Toc.
4 source ../after/ftplugin/markdown.vim
8 setlocal foldmethod=manual
20 # this is another comment
71 AssertEqual foldlevel(1), 0, '# chap 1'
72 AssertEqual foldlevel(3), 1, 'hello'
73 AssertEqual foldlevel(6), 1, '```bash'
74 AssertEqual foldlevel(7), 1, '# some bash scripting'
75 AssertEqual foldlevel(15), 1, '## chap 1.1'
76 AssertEqual foldlevel(21), 2, 'mkdir foo'
77 AssertEqual foldlevel(22), 2, 'comment in ~'
78 AssertEqual foldlevel(25), 2, '### chap 1.1.1'
79 AssertEqual foldlevel(27), 3, '- dragons'
80 AssertEqual foldlevel(30), 1, '# chap 2'
81 AssertEqual foldlevel(32), 1, 'another'
82 AssertEqual foldlevel(34), 1, '# chap 2.1'
83 AssertEqual foldlevel(37), 2, '- japan'
84 AssertEqual foldlevel(41), 1, '# chap 3'
85 AssertEqual foldlevel(45), 1, 'chap 4\n======'
86 AssertEqual foldlevel(48), 1, 'setext are evil'
87 AssertEqual foldlevel(50), 2, 'chap 4.1\n------'
88 " BUG: for lines 30, 41, 45, the foldlevel should be 0.
89 " The folding behavior itself is correct, but the level number isn't.
91 Execute (fold text result):
92 AssertEqual foldtextresult(2), '+-- 28 lines: hello'
93 AssertEqual foldtextresult(31), '+-- 10 lines: another'
94 AssertEqual foldtextresult(42), '+-- 3 lines: nothing here'
95 AssertEqual foldtextresult(45), '+-- 14 lines: chap 4'
96 " BUG: for line 45, vim shows and calling foldtextresult even echoes 15 lines.
101 let res = getloclist(0)
103 AssertEqual elem.lnum, 1
104 AssertEqual elem.text, '# chap 1'
106 AssertEqual elem.lnum, 15
107 AssertEqual elem.text, '## chap 1.1'
109 AssertEqual elem.lnum, 25
110 AssertEqual elem.text, '### chap 1.1.1'
112 AssertEqual elem.lnum, 30
113 AssertEqual elem.text, '# chap 2'
115 AssertEqual elem.lnum, 34
116 AssertEqual elem.text, '## chap 2.1'
118 AssertEqual elem.lnum, 41
119 AssertEqual elem.text, '# chap 3'
121 AssertEqual elem.lnum, 45
122 AssertEqual elem.text, 'chap 4'
124 AssertEqual elem.lnum, 50
125 AssertEqual elem.text, 'chap 4.1'