aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-24 11:28:10 +0800
committerGitHub <noreply@github.com>2023-08-24 11:28:10 +0800
commita9418ef8cfc00943fcd6f8f2236783442e09e91b (patch)
tree8ea75c62a7380503e6d0f71c561798d8d6825c3d /test
parente2c10dea19a329f7913eb1d6110f10ec4bc525f9 (diff)
downloadrneovim-a9418ef8cfc00943fcd6f8f2236783442e09e91b.tar.gz
rneovim-a9418ef8cfc00943fcd6f8f2236783442e09e91b.tar.bz2
rneovim-a9418ef8cfc00943fcd6f8f2236783442e09e91b.zip
fix(ui): wrong display with 0-width inline virt_text at eol (#24854)
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/decorations_spec.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 6c1a7a6a2c..0a3a2e4e29 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1748,7 +1748,7 @@ describe('decorations: inline virtual text', function()
]]}
end)
- it('works with empty chunk', function()
+ it('works with 0-width chunk', function()
screen:try_resize(50, 10)
insert(example_text)
feed 'gg'
@@ -1766,7 +1766,22 @@ describe('decorations: inline virtual text', function()
]]}
meths.buf_set_extmark(0, ns, 0, 5, {virt_text={{''}, {''}}, virt_text_pos='inline'})
- meths.buf_set_extmark(0, ns, 1, 14, {virt_text={{''}, {': ', 'Special'}, {'string', 'Type'}}, virt_text_pos='inline'})
+ meths.buf_set_extmark(0, ns, 1, 14, {virt_text={{''}, {': ', 'Special'}}, virt_text_pos='inline'})
+ meths.buf_set_extmark(0, ns, 1, 48, {virt_text={{''}, {''}}, virt_text_pos='inline'})
+ screen:expect{grid=[[
+ ^for _,item in ipairs(items) do |
+ local text{10:: }, hl_id_cell, count = unpack(item)|
+ if hl_id_cell ~= nil then |
+ hl_id = hl_id_cell |
+ end |
+ for _ = 1, (count or 1) do |
+ local cell = line[colpos] |
+ cell.text = text |
+ cell.hl_id = hl_id |
+ |
+ ]]}
+
+ meths.buf_set_extmark(0, ns, 1, 14, {virt_text={{''}, {'string', 'Type'}}, virt_text_pos='inline'})
feed('V')
screen:expect{grid=[[
^f{7:or _,item in ipairs(items) do} |