aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
authorIbby <33922797+SleepySwords@users.noreply.github.com>2023-03-26 14:49:09 +1100
committerbfredl <bjorn.linse@gmail.com>2023-05-22 13:49:42 +0200
commit43c2eaada220d5e7d44fa9086655b00ee3e5fbb5 (patch)
tree61fdf8837fdb03d17127a6692f0cd7050b528970 /test/functional/ui
parent8eaf3c4f8c2ee4dc5a6e12bb809058ad263dbb65 (diff)
downloadrneovim-43c2eaada220d5e7d44fa9086655b00ee3e5fbb5.tar.gz
rneovim-43c2eaada220d5e7d44fa9086655b00ee3e5fbb5.tar.bz2
rneovim-43c2eaada220d5e7d44fa9086655b00ee3e5fbb5.zip
vim-patch:9.0.0179: cursor pos wrong with wrapping virtual text in empty line
Problem: Cursor position wrong with wrapping virtual text in empty line. Solution: Adjust handling of an empty line. (closes vim/vim#10875) https://github.com/vim/vim/commit/49a90792d950c51608d0459ef8699fe921070718 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/decorations_spec.lua86
1 files changed, 86 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index a2b0138da3..635666c941 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1390,6 +1390,92 @@ end]]
|
]]}
end)
+
+ it('text is drawn correctly when inserting a wrapping virtual text on an empty line', function()
+ feed('o<esc>')
+ insert([[aaaaaaa
+
+bbbbbbb]])
+ meths.buf_set_extmark(0, ns, 0, 0,
+ { virt_text = { { string.rep('X', 51), 'Special' } }, virt_text_pos = 'inline' })
+ meths.buf_set_extmark(0, ns, 2, 0,
+ { virt_text = { { string.rep('X', 50), 'Special' } }, virt_text_pos = 'inline' })
+ feed('gg0')
+ screen:expect { grid = [[
+ {28:^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}|
+ {28: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lines', function()