comparison src/testdir/test_listlbr.vim @ 32981:2415680a2554 v9.0.1783

commit b557f4898208105b674df605403cac1b1292707b Author: zeertzjq <zeertzjq@outlook.com> Date: Tue Aug 22 22:07:34 2023 +0200 patch 9.0.1783: Display issues with virt text smoothscroll and showbreak Problem: Wrong display with wrapping virtual text or unprintable chars, 'showbreak' and 'smoothscroll'. Solution: Don't skip cells taken by 'showbreak' in screen lines before "w_skipcol". Combined "n_skip" and "skip_cells". closes: #12597 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author Christian Brabandt <cb@256bit.org>
date Thu, 24 Aug 2023 07:47:10 +0200
parents fe1550f920d8
children 886e7c8f7614
comparison
equal deleted inserted replaced
32964:c7a332a34fe7 32981:2415680a2554
13 function s:screen_lines(lnum, width) abort 13 function s:screen_lines(lnum, width) abort
14 return ScreenLines(a:lnum, a:width) 14 return ScreenLines(a:lnum, a:width)
15 endfunction 15 endfunction
16 16
17 func s:compare_lines(expect, actual) 17 func s:compare_lines(expect, actual)
18 call assert_equal(join(a:expect, "\n"), join(a:actual, "\n")) 18 call assert_equal(a:expect, a:actual)
19 endfunc 19 endfunc
20 20
21 function s:test_windows(...) 21 function s:test_windows(...)
22 call NewWindow(10, 20) 22 call NewWindow(10, 20)
23 setl ts=8 sw=4 sts=4 linebreak sbr= wrap 23 setl ts=8 sw=4 sts=4 linebreak sbr= wrap
329 \ ] 329 \ ]
330 call s:compare_lines(expect, lines) 330 call s:compare_lines(expect, lines)
331 call s:close_windows() 331 call s:close_windows()
332 endfunc 332 endfunc
333 333
334 func Test_ctrl_char_on_wrap_column()
335 call s:test_windows("setl nolbr wrap sbr=")
336 call setline(1, 'aaa' .. repeat("\<C-A>", 150) .. 'bbb')
337 call cursor(1,1)
338 norm! $
339 redraw!
340 let expect=[
341 \ '<<<^A^A^A^A^A^A^A^A^',
342 \ 'A^A^A^A^A^A^A^A^A^A^',
343 \ 'A^A^A^A^A^A^A^A^A^A^',
344 \ 'A^A^A^A^A^A^A^A^A^A^',
345 \ 'A^A^A^A^A^A^A^A^A^A^',
346 \ 'A^A^A^A^A^A^A^A^A^A^',
347 \ 'A^A^A^A^A^A^A^A^A^A^',
348 \ 'A^A^A^A^A^A^A^A^A^A^',
349 \ 'A^A^A^A^A^A^A^A^A^A^',
350 \ 'A^Abbb ']
351 let lines = s:screen_lines([1, 10], winwidth(0))
352 call s:compare_lines(expect, lines)
353 call assert_equal(len(expect), winline())
354 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
355 setl sbr=!!
356 redraw!
357 let expect=[
358 \ '!!A^A^A^A^A^A^A^A^A^',
359 \ '!!A^A^A^A^A^A^A^A^A^',
360 \ '!!A^A^A^A^A^A^A^A^A^',
361 \ '!!A^A^A^A^A^A^A^A^A^',
362 \ '!!A^A^A^A^A^A^A^A^A^',
363 \ '!!A^A^A^A^A^A^A^A^A^',
364 \ '!!A^A^A^A^A^A^A^A^A^',
365 \ '!!A^A^A^A^A^A^A^A^A^',
366 \ '!!A^A^A^A^A^A^A^A^A^',
367 \ '!!A^A^A^A^A^A^Abbb ']
368 let lines = s:screen_lines([1, 10], winwidth(0))
369 call s:compare_lines(expect, lines)
370 call assert_equal(len(expect), winline())
371 call assert_equal(strwidth(trim(expect[-1], ' ', 2)), wincol())
372 call s:close_windows()
373 endfunc
374
334 " vim: shiftwidth=2 sts=2 expandtab 375 " vim: shiftwidth=2 sts=2 expandtab