Patch 9.0.1491
Problem: Wrong scrolling with ls=0 and :botright split.
Solution: Add statusline before calling frame_new_height(). (closes #12299)
Files: src/window.c, src/testdir/test_window_cmd.vim
*** ../vim-9.0.1490/src/window.c 2023-04-22 22:54:28.053802328 +0100
--- src/window.c 2023-04-26 18:54:39.339277081 +0100
***************
*** 1307,1312 ****
--- 1307,1313 ----
// "new_size" of the current window goes to the new window, use
// one row for the status line
win_new_height(wp, new_size);
+ int old_status_height = oldwin->w_status_height;
if (flags & (WSP_TOP | WSP_BOT))
{
int new_fr_height = curfrp->fr_height - new_size
***************
*** 1314,1319 ****
--- 1315,1322 ----
if (!((flags & WSP_BOT) && p_ls == 0))
new_fr_height -= STATUS_HEIGHT;
+ if (flags & WSP_BOT)
+ frame_add_statusline(curfrp);
frame_new_height(curfrp, new_fr_height, flags & WSP_TOP, FALSE);
}
else
***************
*** 1328,1339 ****
{
wp->w_winrow = oldwin->w_winrow + VISIBLE_HEIGHT(oldwin)
+ STATUS_HEIGHT;
! wp->w_status_height = oldwin->w_status_height;
if (!(flags & WSP_BOT))
oldwin->w_status_height = STATUS_HEIGHT;
}
- if (flags & WSP_BOT)
- frame_add_statusline(curfrp);
frame_fix_height(wp);
frame_fix_height(oldwin);
}
--- 1331,1340 ----
{
wp->w_winrow = oldwin->w_winrow + VISIBLE_HEIGHT(oldwin)
+ STATUS_HEIGHT;
! wp->w_status_height = old_status_height;
if (!(flags & WSP_BOT))
oldwin->w_status_height = STATUS_HEIGHT;
}
frame_fix_height(wp);
frame_fix_height(oldwin);
}
***************
*** 3791,3802 ****
if (frp->fr_layout == FR_LEAF)
{
wp = frp->fr_win;
! if (wp->w_status_height == 0)
! {
! if (wp->w_height > 0) // don't make it negative
! --wp->w_height;
! wp->w_status_height = STATUS_HEIGHT;
! }
}
else if (frp->fr_layout == FR_ROW)
{
--- 3792,3798 ----
if (frp->fr_layout == FR_LEAF)
{
wp = frp->fr_win;
! wp->w_status_height = STATUS_HEIGHT;
}
else if (frp->fr_layout == FR_ROW)
{
*** ../vim-9.0.1490/src/testdir/test_window_cmd.vim 2023-03-01
17:55:26.983125731 +0000
--- src/testdir/test_window_cmd.vim 2023-04-26 18:54:39.335277079 +0100
***************
*** 19,24 ****
--- 19,42 ----
set ls&vim
endfunc
+ func Test_window_cmd_ls0_split_scrolling()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set laststatus=0
+ call setline(1, range(1, 100))
+ normal! G
+ END
+ call writefile(lines, 'XTestLs0SplitScrolling', 'D')
+ let buf = RunVimInTerminal('-S XTestLs0SplitScrolling', #{rows: 10})
+
+ call term_sendkeys(buf, ":botright split\<CR>")
+ call WaitForAssert({-> assert_match('Bot$', term_getline(buf, 5))})
+ call assert_equal('100', term_getline(buf, 4))
+
+ call StopVimInTerminal(buf)
+ endfunc
+
func Test_window_cmd_cmdwin_with_vsp()
let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
for v in range(0, 2)
*** ../vim-9.0.1490/src/version.c 2023-04-26 16:50:14.165974688 +0100
--- src/version.c 2023-04-26 18:55:58.527376654 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1491,
/**/
--
"Lisp has all the visual appeal of oatmeal with nail clippings thrown in."
-- Larry Wall
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230426180220.A8A611C0633%40moolenaar.net.