aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-24 22:15:13 +0800
committerGitHub <noreply@github.com>2023-06-24 22:15:13 +0800
commit8182384205d3c222e999ea9a78276cbf685f50fd (patch)
treea60b34b6db96f21eaaa21acbde8712ea505ce67d
parent57fda7688b815f1d99e645d371a06332948ac197 (diff)
downloadrneovim-8182384205d3c222e999ea9a78276cbf685f50fd.tar.gz
rneovim-8182384205d3c222e999ea9a78276cbf685f50fd.tar.bz2
rneovim-8182384205d3c222e999ea9a78276cbf685f50fd.zip
test(extmarks): add a test for #23848 (#24140)
-rw-r--r--test/functional/ui/decorations_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index e8ad0d3f0d..4c04bad3a0 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -2507,6 +2507,42 @@ bbbbbbb]])
]]}
end)
+ it('does not crash at right edge of wide window #23848', function()
+ screen:try_resize(82, 5)
+ meths.buf_set_extmark(0, ns, 0, 0, {virt_text = {{('a'):rep(82)}, {'b'}}, virt_text_pos = 'inline'})
+ screen:expect{grid=[[
+ ^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ b |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
+ command('set nowrap')
+ screen:expect{grid=[[
+ ^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
+ feed('82i0<Esc>0')
+ screen:expect{grid=[[
+ ^0000000000000000000000000000000000000000000000000000000000000000000000000000000000|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
+ command('set wrap')
+ screen:expect{grid=[[
+ ^0000000000000000000000000000000000000000000000000000000000000000000000000000000000|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ b |
+ {1:~ }|
+ |
+ ]]}
+ end)
+
it('list "extends" is drawn with only inline virtual text offscreen', function()
command('set nowrap')
command('set list')