aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_statusline.vim19
-rw-r--r--src/nvim/window.c8
2 files changed, 22 insertions, 5 deletions
diff --git a/src/nvim/testdir/test_statusline.vim b/src/nvim/testdir/test_statusline.vim
index 8c81ec3431..7efd181d04 100644
--- a/src/nvim/testdir/test_statusline.vim
+++ b/src/nvim/testdir/test_statusline.vim
@@ -412,3 +412,22 @@ func Test_statusline_removed_group()
call StopVimInTerminal(buf)
call delete('XTest_statusline')
endfunc
+
+func Test_statusline_after_split_vsplit()
+ only
+
+ " Make the status line of each window show the window number.
+ set ls=2 stl=%{winnr()}
+
+ split | redraw
+ vsplit | redraw
+
+ " The status line of the third window should read '3' here.
+ call assert_equal('3', nr2char(screenchar(&lines - 1, 1)))
+
+ only
+ set ls& stl&
+endfunc
+
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 6608deb231..e53570edd8 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1490,13 +1490,11 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
if (flags & (WSP_TOP | WSP_BOT))
(void)win_comp_pos();
- /*
- * Both windows need redrawing
- */
+ // Both windows need redrawing. Update all status lines, in case they
+ // show something related to the window count or position.
redraw_win_later(wp, NOT_VALID);
- wp->w_redr_status = TRUE;
redraw_win_later(oldwin, NOT_VALID);
- oldwin->w_redr_status = TRUE;
+ status_redraw_all();
if (need_status) {
msg_row = Rows - 1;