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.
6 let b:line = getline(1)
7 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition')
8 AssertEqual b:func(1, match(b:line, 'a') + 1), ''
9 AssertEqual b:func(1, match(b:line, '<') + 1), b:url
10 AssertEqual b:func(1, match(b:line, 'h') + 1), b:url
11 AssertEqual b:func(1, match(b:line, '>') + 1), b:url
12 AssertEqual b:func(1, match(b:line, 'c') + 1), ''
17 Execute (gx implicit autolink):
18 let b:url = 'http://b.bb'
19 let b:line = getline(1)
20 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition')
21 AssertEqual b:func(1, match(b:line, 'a') + 1), ''
22 AssertEqual b:func(1, match(b:line, 'h') + 1), b:url
23 AssertEqual b:func(1, match(b:line, 'c') + 1), ''
28 Execute (gx link reference definition):
29 let b:url = 'http://b'
30 let b:line = getline(1)
31 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition')
32 " TODO would be cool if all of the following gave the link.
33 AssertEqual b:func(1, match(b:line, 'a') + 1), ''
34 AssertEqual b:func(1, match(b:line, 'h') + 1), b:url
35 AssertEqual b:func(1, match(b:line, 'c') + 1), ''
40 Execute (gx autolink):
42 let b:line = getline(1)
43 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_GetUrlForPosition')
44 AssertEqual b:func(1, match(b:line, 'a') + 1), ''
45 AssertEqual b:func(1, match(b:line, '[') + 1), b:url
46 AssertEqual b:func(1, match(b:line, 'b') + 1), b:url
47 AssertEqual b:func(1, match(b:line, ']') + 1), b:url
48 AssertEqual b:func(1, match(b:line, '(') + 1), b:url
49 AssertEqual b:func(1, match(b:line, 'c') + 1), b:url
50 AssertEqual b:func(1, match(b:line, ')') + 1), b:url
51 AssertEqual b:func(1, match(b:line, 'd') + 1), ''
54 [ge_test.md](ge_test.md)
56 Execute (ge opens file):
58 AssertEqual @%, 'ge_test.md'
59 AssertEqual getline(1), 'ge test'
64 Execute (ge opens file without .md extensions):
65 let g:vim_markdown_no_extensions_in_markdown = 1
67 AssertEqual @%, 'ge_test.md'
68 AssertEqual getline(1), 'ge test'
69 unlet g:vim_markdown_no_extensions_in_markdown
72 [ge_test.md](ge_test.md)
74 Execute (ge does not write before opening file):
78 AssertEqual @%, 'ge_test.md'
79 AssertEqual getline(1), 'ge test'
82 [ge_test.md](ge_test.md)
84 Execute (ge auto-write before opening file):
85 let g:vim_markdown_autowrite = 1
88 AssertThrows normal ge
89 AssertEqual g:vader_exception, 'Vim(write):E382: Cannot write, ''buftype'' option is set'
90 unlet g:vim_markdown_autowrite
101 Execute (]] same level):
102 AssertEqual line('.'), 1
104 AssertEqual line('.'), 5
106 AssertEqual line('.'), 1
117 Execute (]] different levels level):
118 AssertEqual line('.'), 1
120 AssertEqual line('.'), 5
122 AssertEqual line('.'), 1
137 Execute (][ different levels level):
138 AssertEqual line('.'), 1
140 AssertEqual line('.'), 9
142 AssertEqual line('.'), 1
151 AssertEqual line('.'), 3
153 AssertEqual line('.'), 1