comparison src/testdir/test_search_stat.vim @ 27704:4c68fb88b73f v8.2.4378

patch 8.2.4378: incsearch HL broken when calling searchcount in 'tabLine' Commit: https://github.com/vim/vim/commit/6dd7424c7e6ab81998c29ca3526c41b75cfde5a1 Author: Christian Brabandt <cb@256bit.org> Date: Mon Feb 14 12:44:32 2022 +0000 patch 8.2.4378: incsearch HL broken when calling searchcount in 'tabLine' Problem: Incsearch highlight broken when calling searchcount() in 'tabLine' function. (Mirko Palmer) Solution: Save and restore the incsearch state. (Christian Brabandt, closes #9763, closes #9633)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Feb 2022 13:45:02 +0100
parents 95d6e3c9aa1e
children 86eb4aba16c3
comparison
equal deleted inserted replaced
27703:0d4c4c3ca0d0 27704:4c68fb88b73f
369 369
370 call StopVimInTerminal(buf) 370 call StopVimInTerminal(buf)
371 call delete('Xsearchstatgd') 371 call delete('Xsearchstatgd')
372 endfunc 372 endfunc
373 373
374 func Test_search_stat_and_incsearch()
375 CheckScreendump
376
377 let lines =<< trim END
378 call setline(1, ['abc--c', '--------abc', '--abc'])
379 set hlsearch
380 set incsearch
381 set bg=dark
382 set showtabline=2
383
384 function MyTabLine()
385 try
386 let a=searchcount(#{recompute: 1, maxcount: -1})
387 return a.current .. '/' .. a.total
388 catch
389 return ''
390 endtry
391 endfunction
392
393 set tabline=%!MyTabLine()
394 END
395 call writefile(lines, 'Xsearchstat_inc')
396
397 let buf = RunVimInTerminal('-S Xsearchstat_inc', #{rows: 10})
398 call term_sendkeys(buf, "/abc")
399 call TermWait(buf)
400 call VerifyScreenDump(buf, 'Test_searchstat_inc_1', {})
401
402 call term_sendkeys(buf, "\<c-g>")
403 call TermWait(buf)
404 call VerifyScreenDump(buf, 'Test_searchstat_inc_2', {})
405
406 call term_sendkeys(buf, "\<c-g>")
407 call TermWait(buf)
408 call VerifyScreenDump(buf, 'Test_searchstat_inc_3', {})
409
410 call term_sendkeys(buf, "\<esc>:qa\<cr>")
411 call TermWait(buf)
412
413 call StopVimInTerminal(buf)
414 call delete('Xsearchstat_inc')
415 endfunc
374 416
375 417
376 " vim: shiftwidth=2 sts=2 expandtab 418 " vim: shiftwidth=2 sts=2 expandtab