diff options
author | Ibby <33922797+SleepySwords@users.noreply.github.com> | 2023-04-20 02:15:49 +1000 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-05-22 13:49:42 +0200 |
commit | a37c99048359c27bbb7e1997c2ec318bb2cba787 (patch) | |
tree | 0408efd6300edb0133e960749b65d3faa65a8f0b | |
parent | 34d862942c3387eaa9d2bba963d931d384031b90 (diff) | |
download | rneovim-a37c99048359c27bbb7e1997c2ec318bb2cba787.tar.gz rneovim-a37c99048359c27bbb7e1997c2ec318bb2cba787.tar.bz2 rneovim-a37c99048359c27bbb7e1997c2ec318bb2cba787.zip |
fix(ui): fix overflowing nowrap virtual text not displaying if tab follows
-rw-r--r-- | src/nvim/drawline.c | 1 | ||||
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index abc27c1eda..ad08fd0e10 100644 --- 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 index 68a5bb5f9a..f67c4be419 100644 --- 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() |