@@ -7,11 +7,11 @@ async_tests.describe('callout.md', function()
7
7
8
8
local expected = {}
9
9
10
- -- Note
10
+ local note_start = 0
11
11
vim .list_extend (expected , {
12
12
-- Heading
13
13
{
14
- row = { 0 , 1 },
14
+ row = { note_start , note_start + 1 },
15
15
col = { 0 , 0 },
16
16
hl_eol = true ,
17
17
hl_group = ' DiffAdd' ,
@@ -20,32 +20,50 @@ async_tests.describe('callout.md', function()
20
20
},
21
21
-- Quote start
22
22
{
23
- row = { 2 , 2 },
23
+ row = { note_start + 2 , note_start + 2 },
24
24
col = { 0 , 2 },
25
25
virt_text = { { ' ┃ ' , ' DiagnosticInfo' } },
26
26
virt_text_pos = ' overlay' ,
27
27
},
28
28
-- Callout text
29
29
{
30
- row = { 2 , 2 },
30
+ row = { note_start + 2 , note_start + 2 },
31
31
col = { 2 , 9 },
32
32
virt_text = { { ' Note' , ' DiagnosticInfo' } },
33
33
virt_text_pos = ' overlay' ,
34
34
},
35
35
-- Quote continued
36
36
{
37
- row = { 3 , 3 },
37
+ row = { note_start + 3 , note_start + 3 },
38
+ col = { 0 , 1 },
39
+ virt_text = { { ' ┃' , ' DiagnosticInfo' } },
40
+ virt_text_pos = ' overlay' ,
41
+ },
42
+ {
43
+ row = { note_start + 4 , note_start + 4 },
44
+ col = { 0 , 2 },
45
+ virt_text = { { ' ┃ ' , ' DiagnosticInfo' } },
46
+ virt_text_pos = ' overlay' ,
47
+ },
48
+ {
49
+ row = { note_start + 5 , note_start + 5 },
50
+ col = { 0 , 1 },
51
+ virt_text = { { ' ┃' , ' DiagnosticInfo' } },
52
+ virt_text_pos = ' overlay' ,
53
+ },
54
+ {
55
+ row = { note_start + 6 , note_start + 6 },
38
56
col = { 0 , 2 },
39
57
virt_text = { { ' ┃ ' , ' DiagnosticInfo' } },
40
58
virt_text_pos = ' overlay' ,
41
59
},
42
60
})
43
61
44
- -- Tip
62
+ local tip_start = 8
45
63
vim .list_extend (expected , {
46
64
-- Heading
47
65
{
48
- row = { 5 , 6 },
66
+ row = { tip_start , tip_start + 1 },
49
67
col = { 0 , 0 },
50
68
hl_eol = true ,
51
69
hl_group = ' DiffAdd' ,
@@ -54,32 +72,32 @@ async_tests.describe('callout.md', function()
54
72
},
55
73
-- Quote start
56
74
{
57
- row = { 7 , 7 },
75
+ row = { tip_start + 2 , tip_start + 2 },
58
76
col = { 0 , 2 },
59
77
virt_text = { { ' ┃ ' , ' DiagnosticOk' } },
60
78
virt_text_pos = ' overlay' ,
61
79
},
62
80
-- Callout text
63
81
{
64
- row = { 7 , 7 },
82
+ row = { tip_start + 2 , tip_start + 2 },
65
83
col = { 2 , 8 },
66
84
virt_text = { { ' Tip' , ' DiagnosticOk' } },
67
85
virt_text_pos = ' overlay' ,
68
86
},
69
87
-- Quote continued
70
88
{
71
- row = { 8 , 8 },
89
+ row = { tip_start + 3 , tip_start + 3 },
72
90
col = { 0 , 2 },
73
91
virt_text = { { ' ┃ ' , ' DiagnosticOk' } },
74
92
virt_text_pos = ' overlay' ,
75
93
},
76
94
})
77
95
78
- -- Important
96
+ local important_start = 13
79
97
vim .list_extend (expected , {
80
98
-- Heading
81
99
{
82
- row = { 10 , 11 },
100
+ row = { important_start , important_start + 1 },
83
101
col = { 0 , 0 },
84
102
hl_eol = true ,
85
103
hl_group = ' DiffAdd' ,
@@ -88,32 +106,32 @@ async_tests.describe('callout.md', function()
88
106
},
89
107
-- Quote start
90
108
{
91
- row = { 12 , 12 },
109
+ row = { important_start + 2 , important_start + 2 },
92
110
col = { 0 , 2 },
93
111
virt_text = { { ' ┃ ' , ' DiagnosticHint' } },
94
112
virt_text_pos = ' overlay' ,
95
113
},
96
114
-- Callout text
97
115
{
98
- row = { 12 , 12 },
116
+ row = { important_start + 2 , important_start + 2 },
99
117
col = { 2 , 14 },
100
118
virt_text = { { ' Important' , ' DiagnosticHint' } },
101
119
virt_text_pos = ' overlay' ,
102
120
},
103
121
-- Quote continued
104
122
{
105
- row = { 13 , 13 },
123
+ row = { important_start + 3 , important_start + 3 },
106
124
col = { 0 , 2 },
107
125
virt_text = { { ' ┃ ' , ' DiagnosticHint' } },
108
126
virt_text_pos = ' overlay' ,
109
127
},
110
128
})
111
129
112
- -- Warning
130
+ local warning_start = 18
113
131
vim .list_extend (expected , {
114
132
-- Heading
115
133
{
116
- row = { 15 , 16 },
134
+ row = { warning_start , warning_start + 1 },
117
135
col = { 0 , 0 },
118
136
hl_eol = true ,
119
137
hl_group = ' DiffAdd' ,
@@ -122,32 +140,32 @@ async_tests.describe('callout.md', function()
122
140
},
123
141
-- Quote start
124
142
{
125
- row = { 17 , 17 },
143
+ row = { warning_start + 2 , warning_start + 2 },
126
144
col = { 0 , 2 },
127
145
virt_text = { { ' ┃ ' , ' DiagnosticWarn' } },
128
146
virt_text_pos = ' overlay' ,
129
147
},
130
148
-- Callout text
131
149
{
132
- row = { 17 , 17 },
150
+ row = { warning_start + 2 , warning_start + 2 },
133
151
col = { 2 , 12 },
134
152
virt_text = { { ' Warning' , ' DiagnosticWarn' } },
135
153
virt_text_pos = ' overlay' ,
136
154
},
137
155
-- Quote continued
138
156
{
139
- row = { 18 , 18 },
157
+ row = { warning_start + 3 , warning_start + 3 },
140
158
col = { 0 , 2 },
141
159
virt_text = { { ' ┃ ' , ' DiagnosticWarn' } },
142
160
virt_text_pos = ' overlay' ,
143
161
},
144
162
})
145
163
146
- -- Caution
164
+ local caution_start = 23
147
165
vim .list_extend (expected , {
148
166
-- Heading
149
167
{
150
- row = { 20 , 21 },
168
+ row = { caution_start , caution_start + 1 },
151
169
col = { 0 , 0 },
152
170
hl_eol = true ,
153
171
hl_group = ' DiffAdd' ,
@@ -156,21 +174,21 @@ async_tests.describe('callout.md', function()
156
174
},
157
175
-- Quote start
158
176
{
159
- row = { 22 , 22 },
177
+ row = { caution_start + 2 , caution_start + 2 },
160
178
col = { 0 , 2 },
161
179
virt_text = { { ' ┃ ' , ' DiagnosticError' } },
162
180
virt_text_pos = ' overlay' ,
163
181
},
164
182
-- Callout text
165
183
{
166
- row = { 22 , 22 },
184
+ row = { caution_start + 2 , caution_start + 2 },
167
185
col = { 2 , 12 },
168
186
virt_text = { { ' Caution' , ' DiagnosticError' } },
169
187
virt_text_pos = ' overlay' ,
170
188
},
171
189
-- Quote continued
172
190
{
173
- row = { 23 , 23 },
191
+ row = { caution_start + 3 , caution_start + 3 },
174
192
col = { 0 , 2 },
175
193
virt_text = { { ' ┃ ' , ' DiagnosticError' } },
176
194
virt_text_pos = ' overlay' ,
0 commit comments