aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-08-29 21:58:07 +0200
committerbfredl <bjorn.linse@gmail.com>2022-08-29 21:58:07 +0200
commit8fd66ff5c57d29a4349c80d3ae769cde12357ac0 (patch)
treeaa9d962ade9d3f5f26c0d043f406eda3be0238c8
parentefacb6e974fa6391bcc916749103f04fa9b9f6f7 (diff)
downloadrneovim-8fd66ff5c57d29a4349c80d3ae769cde12357ac0.tar.gz
rneovim-8fd66ff5c57d29a4349c80d3ae769cde12357ac0.tar.bz2
rneovim-8fd66ff5c57d29a4349c80d3ae769cde12357ac0.zip
fix(redraw): handle switching to a tabpage with larger p_ch value
-rw-r--r--src/nvim/window.c5
-rw-r--r--test/functional/legacy/cmdline_spec.lua4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 29b1b05ade..832cb82bda 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -4343,6 +4343,11 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
// Use the stored value of p_ch, so that it can be different for each tab page.
if (p_ch != curtab->tp_ch_used) {
clear_cmdline = true;
+ if (msg_grid.chars && p_ch < curtab->tp_ch_used) {
+ // TODO(bfredl): a bit expensive, should be enough to invalidate the
+ // region between the old and the new p_ch.
+ grid_invalidate(&msg_grid);
+ }
}
p_ch = curtab->tp_ch_used;
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index fb054eed9a..65b46f793d 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -19,8 +19,6 @@ describe('cmdline', function()
[3] = {reverse = true};
[4] = {bold = true, foreground = Screen.colors.Blue1};
}
- -- TODO(bfredl): redraw with tabs is severly broken. fix it
- feed_command [[ set display-=msgsep ]]
feed_command([[call setline(1, range(30))]])
screen:expect([[
@@ -61,7 +59,7 @@ describe('cmdline', function()
{4:~ }|
|
|
- :tabnew |
+ |
]]}
feed [[gt]]