-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathdoge_comment_jump_wrap.vader
98 lines (83 loc) · 2.47 KB
/
doge_comment_jump_wrap.vader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# ==============================================================================
# Tests the functionality for the g:doge_comment_jump_wrap option.
# ==============================================================================
Given php (PHP function without parameters where g:doge_comment_jump_wrap = 1):
function myFunction() {}
Do (trigger doge and jump forward):
:let g:doge_comment_jump_wrap = 0\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
\<Tab>
\<Tab>
# Trigger 2 additional <Tab> characters.
# The cursor should stay on the last TODO item.
\<Tab>
\<Tab>
Then (the last TODO item should be selected):
AssertEqual 4, line('.')
AssertEqual 24, col('.')
Expect php (generated comment with a description and @return tag):
/**
* [TODO:description]
*
* @return [TODO:type] [TODO:description]
*/
function myFunction() {}
# Jump backwards
Do (trigger doge and jump backwards):
:let g:doge_comment_jump_wrap = 0\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
# Trigger 2 <S-Tab> characters.
# The cursor should stay on the first TODO item.
\<S-Tab>
\<S-Tab>
Then (the first TODO item should be selected):
AssertEqual 2, line('.')
AssertEqual 4, col('.')
Expect php (generated comment with a description and @return tag):
/**
* [TODO:description]
*
* @return [TODO:type] [TODO:description]
*/
function myFunction() {}
# ------------------------------------------------------------------------------
Do (trigger doge and jump forward):
:let g:doge_comment_jump_wrap = 1\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
\<Tab>
\<Tab>
\<Tab>
Then (the first TODO item should be selected):
AssertEqual 2, line('.')
AssertEqual 4, col('.')
Expect php (generated comment with @param and @return tags):
/**
* [TODO:description]
*
* @return [TODO:type] [TODO:description]
*/
function myFunction() {}
# Jump backwards
Do (trigger doge and jump backwards):
:let g:doge_comment_jump_wrap = 1\<CR>
:let g:doge_comment_interactive = 1\<CR>
\<C-d>
\<S-Tab>
\<S-Tab>
\<S-Tab>
Then (the first TODO item should be selected):
AssertEqual 2, line('.')
AssertEqual 4, col('.')
Expect php (generated comment with @param and @return tags):
/**
* [TODO:description]
*
* @return [TODO:type] [TODO:description]
*/
function myFunction() {}
Do (let g:doge_comment_interactive = 0):
# Disable the option again so that upcoming tests will not fail.
:let g:doge_comment_interactive = 0\<CR>