From 0818d655288ebd70de728b13fabcfd01a0e2e2ec Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 15 Oct 2023 19:36:19 +0800 Subject: fix(extmarks): skip virt_text if it is out of window (#25658) --- test/functional/ui/decorations_spec.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index df7de77333..e56f82bd9f 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1456,6 +1456,24 @@ describe('extmark decorations', function() ]]} end) + it('virtual text win_col out of window does not break display #25645', function() + screen:try_resize(51, 6) + command('vnew') + meths.buf_set_lines(0, 0, -1, false, { string.rep('a', 50) }) + screen:expect{grid=[[ + ^aaaaaaaaaaaaaaaaaaaaaaaaa│ | + aaaaaaaaaaaaaaaaaaaaaaaaa│{1:~ }| + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {41:[No Name] [+] }{40:[No Name] }| + | + ]]} + local extmark_opts = { virt_text_win_col = 35, virt_text = { { ' ', 'Comment' } } } + meths.buf_set_extmark(0, ns, 0, 0, extmark_opts) + screen:expect_unchanged() + assert_alive() + end) + it('can have virtual text on folded line', function() insert([[ 11111 -- cgit