From d93684023ff9899139428f60e0a41eea9620fa8e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 30 Jul 2026 07:12:10 +0800 Subject: [PATCH] vim-patch:9.2.0871: screen line is lost when splitting a 'winfixheight' window (#41054) Problem: When the only window has 'winfixheight' set and 'laststatus' is one, splitting it leaves one screen line unused. This happens for example when jumping to an item from a maximized quickfix window (rendcrx) Solution: Do not subtract the height of the status line twice (Hirohito Higashi) fixes: vim/vim#20495 closes: vim/vim#20871 https://github.com/vim/vim/commit/ab36bcc870f47a96c00602bd50bdf1aeb09e71da Co-authored-by: Hirohito Higashi Co-authored-by: Claude Opus 5 (1M context) --- src/nvim/window.c | 4 +--- test/old/testdir/test_window_cmd.vim | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/nvim/window.c b/src/nvim/window.c index b2090ea252..7f38357921 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1319,10 +1319,8 @@ win_T *win_split_ins(int size, int flags, win_T *new_wp, int dir, frame_T *to_fl win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT, oldwin, true); + // w_height now excludes the status line oldwin_height = oldwin->w_height; - if (need_status) { - oldwin_height -= STATUS_HEIGHT; - } } // Only make all windows the same height if one of them (except oldwin) diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim index 2dddaa6d53..783829221e 100644 --- a/test/old/testdir/test_window_cmd.vim +++ b/test/old/testdir/test_window_cmd.vim @@ -2436,6 +2436,23 @@ func Test_winfixheight_resize_wmh_zero() set winminheight& laststatus& endfunc +" Splitting the only window while it has 'winfixheight' set and 'laststatus' is +" one must not leave a screen line unused. +func Test_winfixheight_split_only_window() + set laststatus=1 + new + only! + setlocal winfixheight + split + " Two windows, both with a status line, and the command line. + call assert_equal(&lines - &cmdheight - 2, winheight(1) + winheight(2)) + + only! + setlocal winfixheight& + set laststatus& + bwipe! +endfunc + func Test_window_w_locked_bypass() split Xfoo let s:win = win_getid()