diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-03 22:57:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 22:57:45 +0800 |
commit | 35c3275b4896a65d67caf2a4355d7516b6ddec29 (patch) | |
tree | 8bb3cd8103bf0146af1cb83a2f5c98db3a83977c /test | |
parent | 6da110d617dba6378f770c5d66d523df92f2d355 (diff) | |
download | rneovim-35c3275b4896a65d67caf2a4355d7516b6ddec29.tar.gz rneovim-35c3275b4896a65d67caf2a4355d7516b6ddec29.tar.bz2 rneovim-35c3275b4896a65d67caf2a4355d7516b6ddec29.zip |
fix(plines): handle inline virtual text after last char (#24241)
Also remove dead code in win_lbr_chartabsize().
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 4c04bad3a0..8070ac550d 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1835,7 +1835,7 @@ describe('decorations: inline virtual text', function() ]]} end) - it('text is drawn correctly when inserting a wrapping virtual text on an empty line', function() + it('text is drawn correctly with a wrapping virtual text', function() feed('o<esc>') insert([[aaaaaaa @@ -1899,6 +1899,40 @@ bbbbbbb]]) {1:~ }| | ]]} + + feed('ggic') + screen:expect { grid = [[ + c{10:^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}| + {10:XX} | + aaaaaaa | + {10:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}| + bbbbbbb | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {8:-- INSERT --} | + ]]} + end) + + it('regexp \\%V does not count trailing virtual text', function() + screen:try_resize(50, 4) + meths.buf_set_lines(0, 0, -1, true, {'foofoo', '', 'foofoo'}) + meths.buf_set_extmark(0, ns, 1, 0, { virt_text = {{'barbarbar', 'Special'}}, virt_text_pos = 'inline' }) + feed([[<C-V>G5l<Esc>/foo\n\%V<CR>]]) + screen:expect{grid=[[ + foo{12:^foo } | + {10:barbarbar} | + foofoo | + {16:search hit BOTTOM, continuing at TOP} | + ]]} + feed([[jIbaz<Esc>/foo\nbaz\%V<CR>]]) + screen:expect{grid=[[ + foo{12:^foo } | + {12:baz}{10:barbarbar} | + foofoo | + {16:search hit BOTTOM, continuing at TOP} | + ]]} end) it('cursor position is correct with virtual text attached to hard tabs', function() |