blob: e205df574b5ec2a9752e594c6c0f35dd7092363a [file] [log] [blame]
Bram Moolenaar9dfa3132019-05-04 21:08:40 +02001" Tests for search_stats, when "S" is not in 'shortmess'
Bram Moolenaar9dfa3132019-05-04 21:08:40 +02002
Bram Moolenaar0f63ed32019-09-04 16:32:36 +02003source check.vim
4source screendump.vim
Bram Moolenaarc7a10b32019-05-06 21:37:18 +02005
Bram Moolenaar0f63ed32019-09-04 16:32:36 +02006func Test_search_stat()
Bram Moolenaar9dfa3132019-05-04 21:08:40 +02007 new
8 set shortmess-=S
Bram Moolenaar9ce3fa82019-05-07 21:29:11 +02009 " Append 50 lines with text to search for, "foobar" appears 20 times
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020010 call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10))
11
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020012 call cursor(1, 1)
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020013
14 " searchcount() returns an empty dictionary when previous pattern was not set
15 call assert_equal({}, searchcount(#{pattern: ''}))
16 " but setting @/ should also work (even 'n' nor 'N' was executed)
17 " recompute the count when the last position is different.
18 call assert_equal(
19 \ #{current: 1, exact_match: 1, total: 40, incomplete: 0, maxcount: 99},
20 \ searchcount(#{pattern: 'foo'}))
21 call assert_equal(
22 \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
23 \ searchcount(#{pattern: 'fooooobar'}))
24 call assert_equal(
25 \ #{current: 0, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
26 \ searchcount(#{pattern: 'fooooobar', pos: [2, 1, 0]}))
27 call assert_equal(
28 \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 99},
29 \ searchcount(#{pattern: 'fooooobar', pos: [3, 1, 0]}))
Bram Moolenaar57f75a52020-06-02 22:06:21 +020030 " on last char of match
31 call assert_equal(
32 \ #{current: 1, exact_match: 1, total: 10, incomplete: 0, maxcount: 99},
33 \ searchcount(#{pattern: 'fooooobar', pos: [3, 9, 0]}))
34 " on char after match
35 call assert_equal(
36 \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
37 \ searchcount(#{pattern: 'fooooobar', pos: [3, 10, 0]}))
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020038 call assert_equal(
39 \ #{current: 1, exact_match: 0, total: 10, incomplete: 0, maxcount: 99},
40 \ searchcount(#{pattern: 'fooooobar', pos: [4, 1, 0]}))
41 call assert_equal(
42 \ #{current: 1, exact_match: 0, total: 2, incomplete: 2, maxcount: 1},
43 \ searchcount(#{pattern: 'fooooobar', pos: [4, 1, 0], maxcount: 1}))
44 call assert_equal(
45 \ #{current: 0, exact_match: 0, total: 2, incomplete: 2, maxcount: 1},
46 \ searchcount(#{pattern: 'fooooobar', maxcount: 1}))
47
48 " match at second line
Bram Moolenaar984f0312019-05-24 13:11:47 +020049 let messages_before = execute('messages')
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020050 let @/ = 'fo*\(bar\?\)\?'
51 let g:a = execute(':unsilent :norm! n')
52 let stat = '\[2/50\]'
53 let pat = escape(@/, '()*?'). '\s\+'
54 call assert_match(pat .. stat, g:a)
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020055 call assert_equal(
56 \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
57 \ searchcount(#{recompute: 0}))
Bram Moolenaar984f0312019-05-24 13:11:47 +020058 " didn't get added to message history
59 call assert_equal(messages_before, execute('messages'))
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020060
Bram Moolenaar984f0312019-05-24 13:11:47 +020061 " Match at last line
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020062 call cursor(line('$')-2, 1)
63 let g:a = execute(':unsilent :norm! n')
64 let stat = '\[50/50\]'
65 call assert_match(pat .. stat, g:a)
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020066 call assert_equal(
67 \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
68 \ searchcount(#{recompute: 0}))
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020069
Bram Moolenaar984f0312019-05-24 13:11:47 +020070 " No search stat
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020071 set shortmess+=S
72 call cursor(1, 1)
73 let stat = '\[2/50\]'
74 let g:a = execute(':unsilent :norm! n')
75 call assert_notmatch(pat .. stat, g:a)
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020076 " n does not update search stat
77 call assert_equal(
78 \ #{current: 50, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
79 \ searchcount(#{recompute: 0}))
80 call assert_equal(
81 \ #{current: 2, exact_match: 1, total: 50, incomplete: 0, maxcount: 99},
82 \ searchcount(#{recompute: v:true}))
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020083 set shortmess-=S
84
Bram Moolenaar984f0312019-05-24 13:11:47 +020085 " Many matches
Bram Moolenaar9dfa3132019-05-04 21:08:40 +020086 call cursor(line('$')-2, 1)
87 let @/ = '.'
88 let pat = escape(@/, '()*?'). '\s\+'
89 let g:a = execute(':unsilent :norm! n')
90 let stat = '\[>99/>99\]'
91 call assert_match(pat .. stat, g:a)
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020092 call assert_equal(
93 \ #{current: 100, exact_match: 0, total: 100, incomplete: 2, maxcount: 99},
94 \ searchcount(#{recompute: 0}))
95 call assert_equal(
96 \ #{current: 272, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
Bram Moolenaarea6561a2020-06-01 21:32:45 +020097 \ searchcount(#{recompute: v:true, maxcount: 0, timeout: 200}))
Bram Moolenaare8f5ec02020-06-01 17:28:35 +020098 call assert_equal(
99 \ #{current: 1, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
Bram Moolenaarea6561a2020-06-01 21:32:45 +0200100 \ searchcount(#{recompute: 1, maxcount: 0, pos: [1, 1, 0], timeout: 200}))
Bram Moolenaardc6855a2019-05-18 19:26:29 +0200101 call cursor(line('$'), 1)
102 let g:a = execute(':unsilent :norm! n')
Bram Moolenaar16b58ae2019-09-06 20:40:21 +0200103 let stat = 'W \[1/>99\]'
Bram Moolenaardc6855a2019-05-18 19:26:29 +0200104 call assert_match(pat .. stat, g:a)
Bram Moolenaare8f5ec02020-06-01 17:28:35 +0200105 call assert_equal(
106 \ #{current: 1, exact_match: 1, total: 100, incomplete: 2, maxcount: 99},
107 \ searchcount(#{recompute: 0}))
108 call assert_equal(
109 \ #{current: 1, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
Bram Moolenaarea6561a2020-06-01 21:32:45 +0200110 \ searchcount(#{recompute: 1, maxcount: 0, timeout: 200}))
Bram Moolenaare8f5ec02020-06-01 17:28:35 +0200111 call assert_equal(
112 \ #{current: 271, exact_match: 1, total: 280, incomplete: 0, maxcount: 0},
Bram Moolenaarea6561a2020-06-01 21:32:45 +0200113 \ searchcount(#{recompute: 1, maxcount: 0, pos: [line('$')-2, 1, 0], timeout: 200}))
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200114
Bram Moolenaar984f0312019-05-24 13:11:47 +0200115 " Many matches
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200116 call cursor(1, 1)
117 let g:a = execute(':unsilent :norm! n')
118 let stat = '\[2/>99\]'
119 call assert_match(pat .. stat, g:a)
Bram Moolenaardc6855a2019-05-18 19:26:29 +0200120 call cursor(1, 1)
121 let g:a = execute(':unsilent :norm! N')
Bram Moolenaar16b58ae2019-09-06 20:40:21 +0200122 let stat = 'W \[>99/>99\]'
Bram Moolenaardc6855a2019-05-18 19:26:29 +0200123 call assert_match(pat .. stat, g:a)
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200124
Bram Moolenaar984f0312019-05-24 13:11:47 +0200125 " right-left
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200126 if exists("+rightleft")
127 set rl
128 call cursor(1,1)
129 let @/ = 'foobar'
130 let pat = 'raboof/\s\+'
131 let g:a = execute(':unsilent :norm! n')
132 let stat = '\[20/2\]'
133 call assert_match(pat .. stat, g:a)
134 set norl
135 endif
136
Bram Moolenaar984f0312019-05-24 13:11:47 +0200137 " right-left bottom
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200138 if exists("+rightleft")
139 set rl
140 call cursor('$',1)
141 let pat = 'raboof?\s\+'
142 let g:a = execute(':unsilent :norm! N')
143 let stat = '\[20/20\]'
144 call assert_match(pat .. stat, g:a)
145 set norl
146 endif
147
Bram Moolenaar984f0312019-05-24 13:11:47 +0200148 " right-left back at top
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200149 if exists("+rightleft")
150 set rl
151 call cursor('$',1)
152 let pat = 'raboof/\s\+'
153 let g:a = execute(':unsilent :norm! n')
Bram Moolenaar16b58ae2019-09-06 20:40:21 +0200154 let stat = 'W \[20/1\]'
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200155 call assert_match(pat .. stat, g:a)
156 call assert_match('search hit BOTTOM, continuing at TOP', g:a)
157 set norl
158 endif
159
Bram Moolenaar984f0312019-05-24 13:11:47 +0200160 " normal, back at bottom
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200161 call cursor(1,1)
162 let @/ = 'foobar'
163 let pat = '?foobar\s\+'
164 let g:a = execute(':unsilent :norm! N')
Bram Moolenaar16b58ae2019-09-06 20:40:21 +0200165 let stat = 'W \[20/20\]'
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200166 call assert_match(pat .. stat, g:a)
167 call assert_match('search hit TOP, continuing at BOTTOM', g:a)
Bram Moolenaar16b58ae2019-09-06 20:40:21 +0200168 call assert_match('W \[20/20\]', Screenline(&lines))
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200169
Bram Moolenaar984f0312019-05-24 13:11:47 +0200170 " normal, no match
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200171 call cursor(1,1)
172 let @/ = 'zzzzzz'
173 let g:a = ''
174 try
175 let g:a = execute(':unsilent :norm! n')
176 catch /^Vim\%((\a\+)\)\=:E486/
177 let stat = ''
178 " error message is not redir'ed to g:a, it is empty
179 call assert_true(empty(g:a))
180 catch
181 call assert_false(1)
182 endtry
183
Bram Moolenaar8f46e4c2019-05-24 22:08:15 +0200184 " with count
185 call cursor(1, 1)
186 let @/ = 'fo*\(bar\?\)\?'
187 let g:a = execute(':unsilent :norm! 2n')
188 let stat = '\[3/50\]'
189 let pat = escape(@/, '()*?'). '\s\+'
190 call assert_match(pat .. stat, g:a)
191 let g:a = execute(':unsilent :norm! 2n')
192 let stat = '\[5/50\]'
193 call assert_match(pat .. stat, g:a)
194
195 " with offset
196 call cursor(1, 1)
197 call feedkeys("/fo*\\(bar\\?\\)\\?/+1\<cr>", 'tx')
198 let g:a = execute(':unsilent :norm! n')
199 let stat = '\[5/50\]'
200 let pat = escape(@/ .. '/+1', '()*?'). '\s\+'
201 call assert_match(pat .. stat, g:a)
202
Bram Moolenaar984f0312019-05-24 13:11:47 +0200203 " normal, n comes from a mapping
Bram Moolenaar9ce3fa82019-05-07 21:29:11 +0200204 " Need to move over more than 64 lines to trigger char_avail(.
205 nnoremap n nzv
206 call cursor(1,1)
207 call append(50, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10))
208 call setline(2, 'find this')
209 call setline(70, 'find this')
210 let @/ = 'find this'
211 let pat = '/find this\s\+'
212 let g:a = execute(':unsilent :norm n')
213 " g:a will contain several lines
214 let g:b = split(g:a, "\n")[-1]
215 let stat = '\[1/2\]'
216 call assert_match(pat .. stat, g:b)
217 unmap n
218
Bram Moolenaar984f0312019-05-24 13:11:47 +0200219 " normal, but silent
Bram Moolenaar9ce3fa82019-05-07 21:29:11 +0200220 call cursor(1,1)
221 let @/ = 'find this'
222 let pat = '/find this\s\+'
223 let g:a = execute(':norm! n')
224 let stat = '\[1/2\]'
225 call assert_notmatch(pat .. stat, g:a)
226
Bram Moolenaar19e8ac72019-09-03 22:23:38 +0200227 " normal, n comes from a silent mapping
228 " First test a normal mapping, then a silent mapping
229 call cursor(1,1)
230 nnoremap n n
231 let @/ = 'find this'
232 let pat = '/find this\s\+'
233 let g:a = execute(':unsilent :norm n')
234 let g:b = split(g:a, "\n")[-1]
235 let stat = '\[1/2\]'
236 call assert_match(pat .. stat, g:b)
237 nnoremap <silent> n n
238 call cursor(1,1)
239 let g:a = execute(':unsilent :norm n')
240 let g:b = split(g:a, "\n")[-1]
241 let stat = '\[1/2\]'
242 call assert_notmatch(pat .. stat, g:b)
243 call assert_match(stat, g:b)
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200244 " Test that the message is not truncated
245 " it would insert '...' into the output.
246 call assert_match('^\s\+' .. stat, g:b)
Bram Moolenaar19e8ac72019-09-03 22:23:38 +0200247 unmap n
248
Bram Moolenaare8f5ec02020-06-01 17:28:35 +0200249 " Time out
250 %delete _
251 call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 100000))
252 call cursor(1, 1)
253 call assert_equal(1, searchcount(#{pattern: 'foo', maxcount: 0, timeout: 1}).incomplete)
254
Bram Moolenaar19e8ac72019-09-03 22:23:38 +0200255 " Clean up
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200256 set shortmess+=S
Bram Moolenaar19e8ac72019-09-03 22:23:38 +0200257 " close the window
Bram Moolenaar9dfa3132019-05-04 21:08:40 +0200258 bwipe!
259endfunc
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200260
Bram Moolenaar14681622020-06-03 22:57:39 +0200261func Test_searchcount_fails()
Yegappan Lakshmanan04c4c572022-08-30 19:48:24 +0100262 call assert_fails('echo searchcount("boo!")', 'E1206:')
Bram Moolenaar531be472020-09-23 22:38:05 +0200263 call assert_fails('echo searchcount({"timeout" : []})', 'E745:')
264 call assert_fails('echo searchcount({"maxcount" : []})', 'E745:')
265 call assert_fails('echo searchcount({"pattern" : []})', 'E730:')
266 call assert_fails('echo searchcount({"pos" : 1})', 'E475:')
267 call assert_fails('echo searchcount({"pos" : [1]})', 'E475:')
268 call assert_fails('echo searchcount({"pos" : [[], 2, 3]})', 'E745:')
269 call assert_fails('echo searchcount({"pos" : [1, [], 3]})', 'E745:')
270 call assert_fails('echo searchcount({"pos" : [1, 2, []]})', 'E745:')
Bram Moolenaar14681622020-06-03 22:57:39 +0200271endfunc
272
zeertzjqa7d36b72023-01-31 21:13:38 +0000273func Test_search_stat_narrow_screen()
274 " This used to crash Vim
275 let save_columns = &columns
276 try
277 let after =<< trim [CODE]
278 set laststatus=2
279 set columns=16
280 set shortmess-=S showcmd
281 call setline(1, 'abc')
282 call feedkeys("/abc\<CR>:quit!\<CR>")
283 autocmd VimLeavePre * call writefile(["done"], "Xdone")
284 [CODE]
285
286 if !RunVim([], after, '--clean')
287 return
288 endif
289 call assert_equal("done", readfile("Xdone")[0])
290 call delete('Xdone')
291 finally
292 let &columns = save_columns
293 endtry
294endfunc
295
Bram Moolenaar442a8532020-06-04 20:56:09 +0200296func Test_searchcount_in_statusline()
297 CheckScreendump
298
299 let lines =<< trim END
300 set shortmess-=S
301 call append(0, 'this is something')
302 function TestSearchCount() abort
303 let search_count = searchcount()
304 if !empty(search_count)
305 return '[' . search_count.current . '/' . search_count.total . ']'
306 else
307 return ''
308 endif
309 endfunction
310 set hlsearch
311 set laststatus=2 statusline+=%{TestSearchCount()}
312 END
Bram Moolenaar56564962022-10-10 22:39:42 +0100313 call writefile(lines, 'Xsearchstatusline', 'D')
Bram Moolenaar442a8532020-06-04 20:56:09 +0200314 let buf = RunVimInTerminal('-S Xsearchstatusline', #{rows: 10})
315 call TermWait(buf)
316 call term_sendkeys(buf, "/something")
317 call VerifyScreenDump(buf, 'Test_searchstat_4', {})
318
319 call term_sendkeys(buf, "\<Esc>")
320 call StopVimInTerminal(buf)
Bram Moolenaar442a8532020-06-04 20:56:09 +0200321endfunc
322
Bram Moolenaar6cb07262020-05-29 22:49:43 +0200323func Test_search_stat_foldopen()
324 CheckScreendump
325
326 let lines =<< trim END
327 set shortmess-=S
328 setl foldenable foldmethod=indent foldopen-=search
329 call append(0, ['if', "\tfoo", "\tfoo", 'endif'])
330 let @/ = 'foo'
331 call cursor(1,1)
332 norm n
333 END
Bram Moolenaar56564962022-10-10 22:39:42 +0100334 call writefile(lines, 'Xsearchstat1', 'D')
Bram Moolenaar6cb07262020-05-29 22:49:43 +0200335
336 let buf = RunVimInTerminal('-S Xsearchstat1', #{rows: 10})
Bram Moolenaar6cb07262020-05-29 22:49:43 +0200337 call VerifyScreenDump(buf, 'Test_searchstat_3', {})
338
339 call term_sendkeys(buf, "n")
Bram Moolenaar6cb07262020-05-29 22:49:43 +0200340 call VerifyScreenDump(buf, 'Test_searchstat_3', {})
341
342 call term_sendkeys(buf, "n")
Bram Moolenaar6cb07262020-05-29 22:49:43 +0200343 call VerifyScreenDump(buf, 'Test_searchstat_3', {})
344
345 call StopVimInTerminal(buf)
Bram Moolenaar6cb07262020-05-29 22:49:43 +0200346endfunc
347
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200348func! Test_search_stat_screendump()
349 CheckScreendump
350
351 let lines =<< trim END
352 set shortmess-=S
353 " Append 50 lines with text to search for, "foobar" appears 20 times
354 call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 20))
355 call setline(2, 'find this')
356 call setline(70, 'find this')
357 nnoremap n n
358 let @/ = 'find this'
359 call cursor(1,1)
360 norm n
361 END
Bram Moolenaar56564962022-10-10 22:39:42 +0100362 call writefile(lines, 'Xsearchstat', 'D')
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200363 let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10})
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200364 call VerifyScreenDump(buf, 'Test_searchstat_1', {})
365
366 call term_sendkeys(buf, ":nnoremap <silent> n n\<cr>")
367 call term_sendkeys(buf, "gg0n")
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200368 call VerifyScreenDump(buf, 'Test_searchstat_2', {})
369
370 call StopVimInTerminal(buf)
Bram Moolenaar0f63ed32019-09-04 16:32:36 +0200371endfunc
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +0200372
Bram Moolenaar0c711142021-11-12 10:30:04 +0000373func Test_search_stat_then_gd()
374 CheckScreendump
375
376 let lines =<< trim END
377 call setline(1, ['int cat;', 'int dog;', 'cat = dog;'])
378 set shortmess-=S
379 set hlsearch
380 END
Bram Moolenaar56564962022-10-10 22:39:42 +0100381 call writefile(lines, 'Xsearchstatgd', 'D')
Bram Moolenaar0c711142021-11-12 10:30:04 +0000382
383 let buf = RunVimInTerminal('-S Xsearchstatgd', #{rows: 10})
384 call term_sendkeys(buf, "/dog\<CR>")
Bram Moolenaar0c711142021-11-12 10:30:04 +0000385 call VerifyScreenDump(buf, 'Test_searchstatgd_1', {})
386
387 call term_sendkeys(buf, "G0gD")
Bram Moolenaar0c711142021-11-12 10:30:04 +0000388 call VerifyScreenDump(buf, 'Test_searchstatgd_2', {})
389
390 call StopVimInTerminal(buf)
Bram Moolenaar0c711142021-11-12 10:30:04 +0000391endfunc
392
Christian Brabandt6dd74242022-02-14 12:44:32 +0000393func Test_search_stat_and_incsearch()
394 CheckScreendump
395
396 let lines =<< trim END
397 call setline(1, ['abc--c', '--------abc', '--abc'])
398 set hlsearch
399 set incsearch
400 set bg=dark
401 set showtabline=2
402
403 function MyTabLine()
404 try
405 let a=searchcount(#{recompute: 1, maxcount: -1})
406 return a.current .. '/' .. a.total
407 catch
408 return ''
409 endtry
410 endfunction
411
412 set tabline=%!MyTabLine()
413 END
Bram Moolenaar56564962022-10-10 22:39:42 +0100414 call writefile(lines, 'Xsearchstat_inc', 'D')
Christian Brabandt6dd74242022-02-14 12:44:32 +0000415
416 let buf = RunVimInTerminal('-S Xsearchstat_inc', #{rows: 10})
417 call term_sendkeys(buf, "/abc")
418 call TermWait(buf)
419 call VerifyScreenDump(buf, 'Test_searchstat_inc_1', {})
420
421 call term_sendkeys(buf, "\<c-g>")
422 call TermWait(buf)
423 call VerifyScreenDump(buf, 'Test_searchstat_inc_2', {})
424
425 call term_sendkeys(buf, "\<c-g>")
426 call TermWait(buf)
427 call VerifyScreenDump(buf, 'Test_searchstat_inc_3', {})
428
429 call term_sendkeys(buf, "\<esc>:qa\<cr>")
430 call TermWait(buf)
431
432 call StopVimInTerminal(buf)
Christian Brabandt6dd74242022-02-14 12:44:32 +0000433endfunc
Bram Moolenaar0c711142021-11-12 10:30:04 +0000434
435
Bram Moolenaar6d91bcb2020-08-12 18:50:36 +0200436" vim: shiftwidth=2 sts=2 expandtab