commit a37c99048359c27bbb7e1997c2ec318bb2cba787
parent 34d862942c3387eaa9d2bba963d931d384031b90
Author: Ibby <33922797+SleepySwords@users.noreply.github.com>
Date: Thu, 20 Apr 2023 02:15:49 +1000
fix(ui): fix overflowing nowrap virtual text not displaying if tab follows
Diffstat:
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
@@ -1799,6 +1799,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange,
area_attr = 0;
extmark_attr = 0;
virt_inline_i++;
+ n_skip = 0;
// If the text didn't reach until the first window
// column we need to skip cells.
if (skip_cells > 0) {
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
@@ -1983,6 +1983,38 @@ bbbbbbb]])
|
]]}
end)
+
+ it('correctly draws when overflowing virtual text is followed by tab with no wrap', function()
+ command('set nowrap')
+ feed('i<TAB>test<ESC>')
+ meths.buf_set_extmark(
+ 0,
+ ns,
+ 0,
+ 0,
+ { virt_text = { { string.rep('a', 60), 'Special' } }, virt_text_pos = 'inline' }
+ )
+ feed('0')
+ screen:expect({
+ grid = [[
+ {28:aaaaaaaaaaaaaaaaaaaaaa} ^ test |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]],
+ })
+ end)
end)
describe('decorations: virtual lines', function()