diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-28 11:09:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-28 11:09:25 +0800 |
commit | e41b2e34b46a806b0fc59914263f8f4af9ac62f1 (patch) | |
tree | d7c3f57dad838f92cd31dd4d386e6e22ea440fc3 /test | |
parent | 7a8402ac31aa2e155baafbc925c48527511c1e92 (diff) | |
download | rneovim-e41b2e34b46a806b0fc59914263f8f4af9ac62f1.tar.gz rneovim-e41b2e34b46a806b0fc59914263f8f4af9ac62f1.tar.bz2 rneovim-e41b2e34b46a806b0fc59914263f8f4af9ac62f1.zip |
test(extmarks): add test for virt_text_hide with 'smoothscroll' (#23791)
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index b9080cbcf5..0247582cdd 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -827,26 +827,55 @@ describe('extmark decorations', function() end -- ?古古古古?古古 | | ]]} + end) - screen:try_resize(50, 2) + it('virt_text_hide hides overlay virtual text when extmark is off-screen', function() + screen:try_resize(50, 3) command('set nowrap') - meths.buf_set_lines(0, 12, 12, true, {'-- ' .. ('…'):rep(57)}) - feed('G') - meths.buf_set_extmark(0, ns, 12, 123, { virt_text={{'!!!!!', 'ErrorMsg'}}, virt_text_pos='overlay', virt_text_hide=true}) + meths.buf_set_lines(0, 0, -1, true, {'-- ' .. ('…'):rep(57)}) + meths.buf_set_extmark(0, ns, 0, 123, { virt_text={{'!!!!!', 'ErrorMsg'}}, virt_text_pos='overlay', virt_text_hide=true}) screen:expect{grid=[[ ^-- …………………………………………………………………………………………………………{4:!!!!!}……| + {1:~ }| | ]]} feed('40zl') screen:expect{grid=[[ ^………{4:!!!!!}……………………………… | + {1:~ }| | ]]} feed('10zl') screen:expect{grid=[[ ^………………………… | + {1:~ }| + | + ]]} + + command('set wrap smoothscroll') + screen:expect{grid=[[ + -- …………………………………………………………………………………………………………{4:!!!!!}……| + ^………………………… | | ]]} + feed('<C-E>') + screen:expect{grid=[[ + {1:<<<}………………^… | + {1:~ }| + | + ]]} + screen:try_resize(40, 3) + screen:expect{grid=[[ + {1:<<<}{4:!!!!!}……………………………^… | + {1:~ }| + | + ]]} + feed('<C-Y>') + screen:expect{grid=[[ + -- …………………………………………………………………………………………………| + ………{4:!!!!!}……………………………^… | + | + ]]} end) it('can have virtual text of overlay position and styling', function() |