diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-28 05:51:19 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-08-28 06:02:01 +0800 |
commit | c70aa84b2a79e8ac83a930dd5bf473940274cf1c (patch) | |
tree | bcb917f927e688aa4ef92d353a21d3a089a6161e /test/functional | |
parent | 128091a256d64db2f983d70a888b379d7e63f131 (diff) | |
download | rneovim-c70aa84b2a79e8ac83a930dd5bf473940274cf1c.tar.gz rneovim-c70aa84b2a79e8ac83a930dd5bf473940274cf1c.tar.bz2 rneovim-c70aa84b2a79e8ac83a930dd5bf473940274cf1c.zip |
vim-patch:9.0.1800: Cursor position still wrong with 'showbreak' and virtual text
Problem: Cursor position still wrong with 'showbreak' and virtual text
after last character or 'listchars' "eol".
Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also
fix first char of virtual text not shown at the start of a screen
line.
closes: vim/vim#12478
closes: vim/vim#12532
closes: vim/vim#12904
https://github.com/vim/vim/commit/6a3897232aecd3e8b9e8b23955e55c1993e5baec
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index c6d5c20649..5ca554e753 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -2668,7 +2668,45 @@ bbbbbbb]]) ]]} end) - it('list "extends" is drawn with only inline virtual text offscreen', function() + it('lcs-extends is drawn with inline virtual text at end of screen line', function() + exec([[ + setlocal nowrap list listchars=extends:! + call setline(1, repeat('a', 51)) + ]]) + meths.buf_set_extmark(0, ns, 0, 50, { virt_text = { { 'bbb', 'Special' } }, virt_text_pos = 'inline' }) + feed('20l') + screen:expect{grid=[[ + aaaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaaaaaaaaaaaaaaaa{1:!}| + {1:~ }| + | + ]]} + feed('zl') + screen:expect{grid=[[ + aaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{1:!}| + {1:~ }| + | + ]]} + feed('zl') + screen:expect{grid=[[ + aaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{10:b}{1:!}| + {1:~ }| + | + ]]} + feed('zl') + screen:expect{grid=[[ + aaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{10:bb}{1:!}| + {1:~ }| + | + ]]} + feed('zl') + screen:expect{grid=[[ + aaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{10:bbb}a| + {1:~ }| + | + ]]} + end) + + it('lcs-extends is drawn with only inline virtual text offscreen', function() command('set nowrap') command('set list') command('set listchars+=extends:c') @@ -2826,9 +2864,9 @@ bbbbbbb]]) screen:try_resize(30, 6) exec([[ highlight! link LineNr Normal - call setline(1, repeat('a', 28)) setlocal number showbreak=+ breakindent breakindentopt=shift:2 setlocal scrolloff=0 smoothscroll + call setline(1, repeat('a', 28)) normal! $ ]]) meths.buf_set_extmark(0, ns, 0, 27, { virt_text = { { ('123'):rep(23) } }, virt_text_pos = 'inline' }) @@ -3066,8 +3104,8 @@ bbbbbbb]]) it('before TABs with smoothscroll', function() screen:try_resize(30, 6) exec([[ - call setline(1, repeat("\t", 4) .. 'a') setlocal list listchars=tab:<-> scrolloff=0 smoothscroll + call setline(1, repeat("\t", 4) .. 'a') normal! $ ]]) meths.buf_set_extmark(0, ns, 0, 3, { virt_text = { { ('12'):rep(32) } }, virt_text_pos = 'inline' }) |