blob: 1896158907a2efa43c2f1e9daeb27b81536a73f4 [file] [log] [blame]
Bram Moolenaard76a0c12016-08-06 15:29:22 +02001" Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(),
Bram Moolenaar1190cf62017-09-14 14:31:18 +02002" matchaddpos(), matcharg(), matchdelete(), and setmatches().
Bram Moolenaard76a0c12016-08-06 15:29:22 +02003
Bram Moolenaar06029a82019-07-24 14:25:26 +02004source screendump.vim
Bram Moolenaar8c5a2782019-08-07 23:07:07 +02005source check.vim
Bram Moolenaar06029a82019-07-24 14:25:26 +02006
Bram Moolenaar4f416e42016-08-16 16:08:18 +02007function Test_match()
Bram Moolenaard76a0c12016-08-06 15:29:22 +02008 highlight MyGroup1 term=bold ctermbg=red guibg=red
9 highlight MyGroup2 term=italic ctermbg=green guibg=green
10 highlight MyGroup3 term=underline ctermbg=blue guibg=blue
11
12 " --- Check that "matcharg()" returns the correct group and pattern if a match
13 " --- is defined.
14 match MyGroup1 /TODO/
15 2match MyGroup2 /FIXME/
16 3match MyGroup3 /XXX/
17 call assert_equal(['MyGroup1', 'TODO'], matcharg(1))
Bram Moolenaara1449832019-09-01 20:16:52 +020018 call assert_equal(['MyGroup2', 'FIXME'], 2->matcharg())
Bram Moolenaard76a0c12016-08-06 15:29:22 +020019 call assert_equal(['MyGroup3', 'XXX'], matcharg(3))
20
21 " --- Check that "matcharg()" returns an empty list if the argument is not 1,
22 " --- 2 or 3 (only 0 and 4 are tested).
23 call assert_equal([], matcharg(0))
24 call assert_equal([], matcharg(4))
25
26 " --- Check that "matcharg()" returns ['', ''] if a match is not defined.
27 match
28 2match
29 3match
30 call assert_equal(['', ''], matcharg(1))
31 call assert_equal(['', ''], matcharg(2))
32 call assert_equal(['', ''], matcharg(3))
33
34 " --- Check that "matchadd()" and "getmatches()" agree on added matches and
35 " --- that default values apply.
36 let m1 = matchadd("MyGroup1", "TODO")
37 let m2 = matchadd("MyGroup2", "FIXME", 42)
38 let m3 = matchadd("MyGroup3", "XXX", 60, 17)
Bram Moolenaar9f573a82022-09-29 13:50:08 +010039 let ans = [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1000},
40 \ {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 42, 'id': 1001},
Bram Moolenaard76a0c12016-08-06 15:29:22 +020041 \ {'group': 'MyGroup3', 'pattern': 'XXX', 'priority': 60, 'id': 17}]
42 call assert_equal(ans, getmatches())
43
44 " --- Check that "matchdelete()" deletes the matches defined in the previous
45 " --- test correctly.
46 call matchdelete(m1)
Bram Moolenaara1449832019-09-01 20:16:52 +020047 eval m2->matchdelete()
Bram Moolenaard76a0c12016-08-06 15:29:22 +020048 call matchdelete(m3)
49 call assert_equal([], getmatches())
50
51 " --- Check that "matchdelete()" returns 0 if successful and otherwise -1.
52 let m = matchadd("MyGroup1", "TODO")
53 call assert_equal(0, matchdelete(m))
54 call assert_fails('call matchdelete(42)', 'E803:')
55
56 " --- Check that "clearmatches()" clears all matches defined by ":match" and
57 " --- "matchadd()".
58 let m1 = matchadd("MyGroup1", "TODO")
Bram Moolenaara1449832019-09-01 20:16:52 +020059 let m2 = "MyGroup2"->matchadd("FIXME", 42)
Bram Moolenaard76a0c12016-08-06 15:29:22 +020060 let m3 = matchadd("MyGroup3", "XXX", 60, 17)
61 match MyGroup1 /COFFEE/
62 2match MyGroup2 /HUMPPA/
63 3match MyGroup3 /VIM/
64 call clearmatches()
65 call assert_equal([], getmatches())
66
67 " --- Check that "setmatches()" restores a list of matches saved by
68 " --- "getmatches()" without changes. (Matches with equal priority must also
69 " --- remain in the same order.)
70 let m1 = matchadd("MyGroup1", "TODO")
71 let m2 = matchadd("MyGroup2", "FIXME", 42)
72 let m3 = matchadd("MyGroup3", "XXX", 60, 17)
73 match MyGroup1 /COFFEE/
74 2match MyGroup2 /HUMPPA/
75 3match MyGroup3 /VIM/
76 let ml = getmatches()
77 call clearmatches()
78 call setmatches(ml)
79 call assert_equal(ml, getmatches())
80 call clearmatches()
81
82 " --- Check that "setmatches()" will not add two matches with the same ID. The
83 " --- expected behaviour (for now) is to add the first match but not the
84 " --- second and to return 0 (even though it is a matter of debate whether
85 " --- this can be considered successful behaviour).
86 let data = [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1},
87 \ {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}]
88 call assert_fails('call setmatches(data)', 'E801:')
89 call assert_equal([data[0]], getmatches())
90 call clearmatches()
91
92 " --- Check that "setmatches()" returns 0 if successful and otherwise -1.
93 " --- (A range of valid and invalid input values are tried out to generate the
94 " --- return values.)
95 call assert_equal(0, setmatches([]))
96 call assert_equal(0, setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}]))
97 call clearmatches()
Bram Moolenaard83392a2022-09-01 12:22:46 +010098 call assert_fails('call setmatches(0)', 'E1211:')
Bram Moolenaard76a0c12016-08-06 15:29:22 +020099 call assert_fails('call setmatches([0])', 'E474:')
100 call assert_fails("call setmatches([{'wrong key': 'wrong value'}])", 'E474:')
Bram Moolenaar75e15672020-06-28 13:10:22 +0200101 call assert_equal(-1, setmatches([{'group' : 'Search', 'priority' : 10, 'id' : 5, 'pos1' : {}}]))
Bram Moolenaard76a0c12016-08-06 15:29:22 +0200102
103 call setline(1, 'abcdefghijklmnopq')
104 call matchaddpos("MyGroup1", [[1, 5], [1, 8, 3]], 10, 3)
105 1
106 redraw!
107 let v1 = screenattr(1, 1)
108 let v5 = screenattr(1, 5)
109 let v6 = screenattr(1, 6)
110 let v8 = screenattr(1, 8)
111 let v10 = screenattr(1, 10)
112 let v11 = screenattr(1, 11)
113 call assert_notequal(v1, v5)
114 call assert_equal(v6, v1)
115 call assert_equal(v8, v5)
116 call assert_equal(v10, v5)
117 call assert_equal(v11, v1)
118 call assert_equal([{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}], getmatches())
119 call clearmatches()
120
Bram Moolenaar30276f22019-01-24 17:59:39 +0100121 call setline(1, 'abcdΣabcdef')
Bram Moolenaar9f573a82022-09-29 13:50:08 +0100122 eval "MyGroup1"->matchaddpos([[1, 4, 2], [1, 9, 2]], 10, 42)
Bram Moolenaar30276f22019-01-24 17:59:39 +0100123 1
124 redraw!
125 let v1 = screenattr(1, 1)
126 let v4 = screenattr(1, 4)
127 let v5 = screenattr(1, 5)
128 let v6 = screenattr(1, 6)
129 let v7 = screenattr(1, 7)
130 let v8 = screenattr(1, 8)
131 let v9 = screenattr(1, 9)
132 let v10 = screenattr(1, 10)
Bram Moolenaar9f573a82022-09-29 13:50:08 +0100133 call assert_equal([{'group': 'MyGroup1', 'id': 42, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches())
Bram Moolenaar30276f22019-01-24 17:59:39 +0100134 call assert_notequal(v1, v4)
135 call assert_equal(v5, v4)
136 call assert_equal(v6, v1)
137 call assert_equal(v7, v1)
138 call assert_equal(v8, v4)
139 call assert_equal(v9, v4)
140 call assert_equal(v10, v1)
Bram Moolenaard76a0c12016-08-06 15:29:22 +0200141
Bram Moolenaar30276f22019-01-24 17:59:39 +0100142 " Check, that setmatches() can correctly restore the matches from matchaddpos()
143 call matchadd('MyGroup1', '\%2lmatchadd')
144 let m=getmatches()
145 call clearmatches()
146 call setmatches(m)
Bram Moolenaar9f573a82022-09-29 13:50:08 +0100147 call assert_equal([{'group': 'MyGroup1', 'id': 42, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 1106}], getmatches())
Bram Moolenaard76a0c12016-08-06 15:29:22 +0200148
149 highlight MyGroup1 NONE
150 highlight MyGroup2 NONE
151 highlight MyGroup3 NONE
152endfunc
153
Bram Moolenaar49d68bf2019-12-24 15:17:00 +0100154func Test_match_error()
155 call assert_fails('match Error', 'E475:')
156 call assert_fails('match Error /', 'E475:')
157 call assert_fails('4match Error /x/', 'E476:')
158 call assert_fails('match Error /x/ x', 'E488:')
159endfunc
160
161func Test_matchadd_error()
162 call assert_fails("call matchadd('GroupDoesNotExist', 'X')", 'E28:')
Bram Moolenaar9b7bf9e2020-07-11 22:14:59 +0200163 call assert_fails("call matchadd('Search', '\\(')", 'E54:')
Bram Moolenaar49d68bf2019-12-24 15:17:00 +0100164 call assert_fails("call matchadd('Search', 'XXX', 1, 123, 1)", 'E715:')
165 call assert_fails("call matchadd('Error', 'XXX', 1, 3)", 'E798:')
166 call assert_fails("call matchadd('Error', 'XXX', 1, 0)", 'E799:')
Bram Moolenaar99fa7212020-04-26 15:59:55 +0200167 call assert_fails("call matchadd('Error', 'XXX', [], 0)", 'E745:')
Bram Moolenaar75e15672020-06-28 13:10:22 +0200168 call assert_equal(-1, matchadd('', 'pat'))
169 call assert_equal(-1, matchadd('Search', ''))
Bram Moolenaar49d68bf2019-12-24 15:17:00 +0100170endfunc
171
Bram Moolenaar4f416e42016-08-16 16:08:18 +0200172func Test_matchaddpos()
173 syntax on
174 set hlsearch
175
176 call setline(1, ['12345', 'NP'])
177 call matchaddpos('Error', [[1,2], [1,6], [2,2]])
178 redraw!
179 call assert_notequal(screenattr(2,2), 0)
180 call assert_equal(screenattr(2,2), screenattr(1,2))
181 call assert_notequal(screenattr(2,2), screenattr(1,6))
182 1
183 call matchadd('Search', 'N\|\n')
184 redraw!
185 call assert_notequal(screenattr(2,1), 0)
186 call assert_equal(screenattr(2,1), screenattr(1,6))
187 exec "norm! i0\<Esc>"
188 redraw!
189 call assert_equal(screenattr(2,2), screenattr(1,6))
190
Bram Moolenaara6c27ee2016-10-15 14:56:30 +0200191 " Check overlapping pos
192 call clearmatches()
193 call setline(1, ['1234567890', 'NH'])
194 call matchaddpos('Error', [[1,1,5], [1,3,5], [2,2]])
195 redraw!
196 call assert_notequal(screenattr(2,2), 0)
197 call assert_equal(screenattr(2,2), screenattr(1,5))
198 call assert_equal(screenattr(2,2), screenattr(1,7))
199 call assert_notequal(screenattr(2,2), screenattr(1,8))
200
Bram Moolenaar85077472016-10-16 14:35:48 +0200201 call clearmatches()
202 call matchaddpos('Error', [[1], [2,2]])
203 redraw!
204 call assert_equal(screenattr(2,2), screenattr(1,1))
205 call assert_equal(screenattr(2,2), screenattr(1,10))
206 call assert_notequal(screenattr(2,2), screenattr(1,11))
207
Bram Moolenaar75e15672020-06-28 13:10:22 +0200208 " matchaddpos() with line number as 0
209 call clearmatches()
210 let id = matchaddpos('Search', [[0], [3], [0]])
211 call assert_equal([{'group' : 'Search', 'priority' : 10, 'id' : id, 'pos1' : [3]}], getmatches())
212 call clearmatches()
213 let id = matchaddpos('Search', [0, 3, 0])
214 call assert_equal([{'group' : 'Search', 'priority' : 10, 'id' : id, 'pos1' : [3]}], getmatches())
215
Bram Moolenaar4f416e42016-08-16 16:08:18 +0200216 nohl
Bram Moolenaar85077472016-10-16 14:35:48 +0200217 call clearmatches()
Bram Moolenaar4f416e42016-08-16 16:08:18 +0200218 syntax off
219 set hlsearch&
220endfunc
221
Bram Moolenaar50faf022022-09-29 12:50:17 +0100222" Add 12 match positions (previously the limit was 8 positions).
223func Test_matchaddpos_dump()
224 CheckScreendump
225
226 let lines =<< trim END
227 call setline(1, ['1234567890123']->repeat(14))
228 call matchaddpos('Search', range(1, 12)->map({i, v -> [v, v]}))
229 END
230 call writefile(lines, 'Xmatchaddpos', 'D')
231 let buf = RunVimInTerminal('-S Xmatchaddpos', #{rows: 14})
232 call VerifyScreenDump(buf, 'Test_matchaddpos_1', {})
233
234 call StopVimInTerminal(buf)
235endfunc
236
Bram Moolenaar95e51472018-07-28 16:55:56 +0200237func Test_matchaddpos_otherwin()
238 syntax on
239 new
240 call setline(1, ['12345', 'NP'])
241 let winid = win_getid()
242
243 wincmd w
244 call matchadd('Search', '4', 10, -1, {'window': winid})
245 call matchaddpos('Error', [[1,2], [2,2]], 10, -1, {'window': winid})
246 redraw!
247 call assert_notequal(screenattr(1,2), 0)
248 call assert_notequal(screenattr(1,4), 0)
249 call assert_notequal(screenattr(2,2), 0)
250 call assert_equal(screenattr(1,2), screenattr(2,2))
251 call assert_notequal(screenattr(1,2), screenattr(1,4))
252
Bram Moolenaaraff74912019-03-30 18:11:49 +0100253 let savematches = getmatches(winid)
254 let expect = [
Bram Moolenaar9f573a82022-09-29 13:50:08 +0100255 \ {'group': 'Search', 'pattern': '4', 'priority': 10, 'id': 1000},
256 \ {'group': 'Error', 'id': 1001, 'priority': 10, 'pos1': [1, 2, 1], 'pos2': [2, 2, 1]},
Bram Moolenaaraff74912019-03-30 18:11:49 +0100257 \]
258 call assert_equal(expect, savematches)
259
Bram Moolenaar1a3a8912019-08-23 22:31:37 +0200260 eval winid->clearmatches()
Bram Moolenaaraff74912019-03-30 18:11:49 +0100261 call assert_equal([], getmatches(winid))
Bram Moolenaar75e15672020-06-28 13:10:22 +0200262 call assert_fails('echo getmatches(-1)', 'E957:')
Bram Moolenaaraff74912019-03-30 18:11:49 +0100263
264 call setmatches(savematches, winid)
265 call assert_equal(expect, savematches)
266
Bram Moolenaar95e51472018-07-28 16:55:56 +0200267 wincmd w
268 bwipe!
269 call clearmatches()
270 syntax off
271endfunc
272
Bram Moolenaare17bdff2016-08-27 18:34:29 +0200273func Test_matchaddpos_using_negative_priority()
274 set hlsearch
275
276 call clearmatches()
277
278 call setline(1, 'x')
279 let @/='x'
280 redraw!
281 let search_attr = screenattr(1,1)
282
283 let @/=''
284 call matchaddpos('Error', [1], 10)
285 redraw!
286 let error_attr = screenattr(1,1)
287
288 call setline(2, '-1 match priority')
289 call matchaddpos('Error', [2], -1)
290 redraw!
291 let negative_match_priority_attr = screenattr(2,1)
292
293 call assert_notequal(negative_match_priority_attr, search_attr, "Match with negative priority is incorrectly highlighted with Search highlight.")
294 call assert_equal(negative_match_priority_attr, error_attr)
295
296 nohl
297 set hlsearch&
298endfunc
299
Bram Moolenaar49d68bf2019-12-24 15:17:00 +0100300func Test_matchaddpos_error()
301 call assert_fails("call matchaddpos('Error', 1)", 'E686:')
302 call assert_fails("call matchaddpos('Error', [1], 1, 1)", 'E798:')
303 call assert_fails("call matchaddpos('Error', [1], 1, 2)", 'E798:')
304 call assert_fails("call matchaddpos('Error', [1], 1, 0)", 'E799:')
305 call assert_fails("call matchaddpos('Error', [1], 1, 123, 1)", 'E715:')
306 call assert_fails("call matchaddpos('Error', [1], 1, 5, {'window':12345})", 'E957:')
307 " Why doesn't the following error have an error code E...?
308 call assert_fails("call matchaddpos('Error', [{}])", 'E290:')
Bram Moolenaar99fa7212020-04-26 15:59:55 +0200309 call assert_equal(-1, matchaddpos('Error', test_null_list()))
310 call assert_fails("call matchaddpos('Error', [1], [], 1)", 'E745:')
Bram Moolenaar75e15672020-06-28 13:10:22 +0200311 call assert_equal(-1, matchaddpos('Search', [[]]))
312 call assert_fails("call matchaddpos('Search', [[{}]])", 'E728:')
313 call assert_fails("call matchaddpos('Search', [[2, {}]])", 'E728:')
314 call assert_fails("call matchaddpos('Search', [[3, 4, {}]])", 'E728:')
Bram Moolenaar49d68bf2019-12-24 15:17:00 +0100315endfunc
316
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200317func OtherWindowCommon()
Bram Moolenaar06029a82019-07-24 14:25:26 +0200318 let lines =<< trim END
319 call setline(1, 'Hello Vim world')
320 let mid = matchadd('Error', 'world', 1)
321 let winid = win_getid()
322 new
323 END
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200324 call writefile(lines, 'XscriptMatchCommon')
325 let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12})
Bram Moolenaar6a2c5a72020-04-08 21:50:25 +0200326 call TermWait(buf)
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200327 return buf
328endfunc
329
330func Test_matchdelete_other_window()
Bram Moolenaar8c5a2782019-08-07 23:07:07 +0200331 CheckScreendump
332
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200333 let buf = OtherWindowCommon()
Bram Moolenaar06029a82019-07-24 14:25:26 +0200334 call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
335 call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
336
337 call StopVimInTerminal(buf)
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200338 call delete('XscriptMatchCommon')
339endfunc
340
Bram Moolenaar49d68bf2019-12-24 15:17:00 +0100341func Test_matchdelete_error()
342 call assert_fails("call matchdelete(0)", 'E802:')
343 call assert_fails("call matchdelete(1, -1)", 'E957:')
344endfunc
345
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200346func Test_matchclear_other_window()
Bram Moolenaar494e9062020-05-31 21:28:02 +0200347 CheckRunVimInTerminal
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200348 let buf = OtherWindowCommon()
349 call term_sendkeys(buf, ":call clearmatches(winid)\<CR>")
350 call VerifyScreenDump(buf, 'Test_matchclear_1', {})
351
352 call StopVimInTerminal(buf)
353 call delete('XscriptMatchCommon')
354endfunc
355
356func Test_matchadd_other_window()
Bram Moolenaar494e9062020-05-31 21:28:02 +0200357 CheckRunVimInTerminal
Bram Moolenaar4ef18dc2019-07-24 15:28:18 +0200358 let buf = OtherWindowCommon()
359 call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\<CR>")
360 call term_sendkeys(buf, ":\<CR>")
361 call VerifyScreenDump(buf, 'Test_matchadd_1', {})
362
363 call StopVimInTerminal(buf)
364 call delete('XscriptMatchCommon')
Bram Moolenaar06029a82019-07-24 14:25:26 +0200365endfunc
366
Bram Moolenaar0c359af2021-11-29 19:18:57 +0000367func Test_match_in_linebreak()
368 CheckRunVimInTerminal
369
370 let lines =<< trim END
371 set breakindent linebreak breakat+=]
372 call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1)
373 call matchaddpos('ErrorMsg', [[1, 51]])
374 END
Bram Moolenaarb152b6a2022-09-29 21:37:33 +0100375 call writefile(lines, 'XscriptMatchLinebreak', 'D')
Bram Moolenaar0c359af2021-11-29 19:18:57 +0000376 let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10})
Bram Moolenaar0c359af2021-11-29 19:18:57 +0000377 call VerifyScreenDump(buf, 'Test_match_linebreak', {})
378
379 call StopVimInTerminal(buf)
Bram Moolenaar0c359af2021-11-29 19:18:57 +0000380endfunc
381
Bram Moolenaar94fb8272021-12-29 19:22:44 +0000382func Test_match_with_incsearch()
383 CheckRunVimInTerminal
384
385 let lines =<< trim END
386 set incsearch
387 call setline(1, range(20))
388 call matchaddpos('ErrorMsg', [3])
389 END
Bram Moolenaarb152b6a2022-09-29 21:37:33 +0100390 call writefile(lines, 'XmatchWithIncsearch', 'D')
Bram Moolenaar94fb8272021-12-29 19:22:44 +0000391 let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
Bram Moolenaar94fb8272021-12-29 19:22:44 +0000392 call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})
393
394 call term_sendkeys(buf, ":s/0")
395 call VerifyScreenDump(buf, 'Test_match_with_incsearch_2', {})
396
397 call term_sendkeys(buf, "\<CR>")
398 call StopVimInTerminal(buf)
Bram Moolenaar94fb8272021-12-29 19:22:44 +0000399endfunc
400
Bram Moolenaar75e15672020-06-28 13:10:22 +0200401" Test for deleting matches outside of the screen redraw top/bottom lines
402" This should cause a redraw of those lines.
403func Test_matchdelete_redraw()
404 new
405 call setline(1, range(1, 500))
406 call cursor(250, 1)
407 let m1 = matchaddpos('Search', [[250]])
408 let m2 = matchaddpos('Search', [[10], [450]])
409 redraw!
410 let m3 = matchaddpos('Search', [[240], [260]])
411 call matchdelete(m2)
412 let m = getmatches()
413 call assert_equal(2, len(m))
414 call assert_equal([250], m[0].pos1)
415 redraw!
416 call matchdelete(m1)
417 call assert_equal(1, len(getmatches()))
418 bw!
419endfunc
420
Bram Moolenaar0bbca542022-01-11 13:14:54 +0000421func Test_match_tab_with_linebreak()
422 CheckRunVimInTerminal
423
424 let lines =<< trim END
425 set linebreak
426 call setline(1, "\tix")
427 call matchadd('ErrorMsg', '\t')
428 END
Bram Moolenaarb152b6a2022-09-29 21:37:33 +0100429 call writefile(lines, 'XscriptMatchTabLinebreak', 'D')
Bram Moolenaar0bbca542022-01-11 13:14:54 +0000430 let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
Bram Moolenaar0bbca542022-01-11 13:14:54 +0000431 call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})
432
433 call StopVimInTerminal(buf)
Bram Moolenaar0bbca542022-01-11 13:14:54 +0000434endfunc
435
436
Bram Moolenaar9e4d8212016-08-18 23:04:48 +0200437" vim: shiftwidth=2 sts=2 expandtab