comparison src/testdir/test_matchadd_conceal.vim @ 30582:72245f9c9405 v9.0.0626

patch 9.0.0626: too many delete() calls in tests Commit: https://github.com/vim/vim/commit/b152b6a40f729ed81a25d2fa541a4e73e201bec4 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 29 21:37:33 2022 +0100 patch 9.0.0626: too many delete() calls in tests Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible.
author Bram Moolenaar <Bram@vim.org>
date Thu, 29 Sep 2022 22:45:04 +0200
parents 2dcc6c9eb6e6
children
comparison
equal deleted inserted replaced
30581:2e1ec75a7766 30582:72245f9c9405
372 let m = matchadd('Conceal', '=') 372 let m = matchadd('Conceal', '=')
373 setl conceallevel=2 concealcursor=nc 373 setl conceallevel=2 concealcursor=nc
374 normal gg 374 normal gg
375 "==expr== 375 "==expr==
376 END 376 END
377 call writefile(lines, 'Xcolesearch') 377 call writefile(lines, 'Xcolesearch', 'D')
378 let buf = RunVimInTerminal('Xcolesearch', {}) 378 let buf = RunVimInTerminal('Xcolesearch', {})
379 call TermWait(buf, 50) 379 call TermWait(buf, 50)
380 380
381 " Jump to something that is beyond the bottom of the window, 381 " Jump to something that is beyond the bottom of the window,
382 " so there's a scroll down. 382 " so there's a scroll down.
392 " BugFix check: Is the window's cursor column properly updated for hidden 392 " BugFix check: Is the window's cursor column properly updated for hidden
393 " parts of the current line? 393 " parts of the current line?
394 call assert_equal(2, term_getcursor(buf)[1]) 394 call assert_equal(2, term_getcursor(buf)[1])
395 395
396 call StopVimInTerminal(buf) 396 call StopVimInTerminal(buf)
397 call delete('Xcolesearch')
398 endfunc 397 endfunc
399 398
400 func Test_cursor_column_in_concealed_line_after_leftcol_change() 399 func Test_cursor_column_in_concealed_line_after_leftcol_change()
401 CheckRunVimInTerminal 400 CheckRunVimInTerminal
402 401
404 let lines =<< trim END 403 let lines =<< trim END
405 0put = 'ab' .. repeat('-', &columns) .. 'c' 404 0put = 'ab' .. repeat('-', &columns) .. 'c'
406 call matchadd('Conceal', '-') 405 call matchadd('Conceal', '-')
407 set nowrap ss=0 cole=3 cocu=n 406 set nowrap ss=0 cole=3 cocu=n
408 END 407 END
409 call writefile(lines, 'Xcurs-columns') 408 call writefile(lines, 'Xcurs-columns', 'D')
410 let buf = RunVimInTerminal('-S Xcurs-columns', {}) 409 let buf = RunVimInTerminal('-S Xcurs-columns', {})
411 410
412 " Go to the end of the line (3 columns beyond the end of the screen). 411 " Go to the end of the line (3 columns beyond the end of the screen).
413 " Horizontal scroll would center the cursor in the screen line, but conceal 412 " Horizontal scroll would center the cursor in the screen line, but conceal
414 " makes it go to screen column 1. 413 " makes it go to screen column 1.
420 419
421 " BugFix check: Is the window's cursor column properly updated for conceal? 420 " BugFix check: Is the window's cursor column properly updated for conceal?
422 call assert_equal(1, term_getcursor(buf)[1]) 421 call assert_equal(1, term_getcursor(buf)[1])
423 422
424 call StopVimInTerminal(buf) 423 call StopVimInTerminal(buf)
425 call delete('Xcurs-columns')
426 endfunc 424 endfunc
427 425
428 " vim: shiftwidth=2 sts=2 expandtab 426 " vim: shiftwidth=2 sts=2 expandtab