1
0
forked from aniani/vim

patch 8.2.2595: setting 'winminheight' may cause 'lines' to change

Problem:    Setting 'winminheight' may cause 'lines' to change.
Solution:   Also take minimal height of other tabpages into account. (#7899)
This commit is contained in:
Bram Moolenaar
2021-03-13 14:29:05 +01:00
parent 0756f757ed
commit 9e813b3dea
3 changed files with 25 additions and 2 deletions

View File

@@ -1035,6 +1035,27 @@ func Test_opt_winminheight_term()
call delete('Xwinminheight') call delete('Xwinminheight')
endfunc endfunc
func Test_opt_winminheight_term_tabs()
CheckRunVimInTerminal
" The tabline should be taken into account.
let lines =<< trim END
set wmh=0 stal=2
split
split
split
split
tabnew
END
call writefile(lines, 'Xwinminheight')
let buf = RunVimInTerminal('-S Xwinminheight', #{rows: 11})
call term_sendkeys(buf, ":set wmh=1\n")
call WaitForAssert({-> assert_match('E36: Not enough room', term_getline(buf, 11))})
call StopVimInTerminal(buf)
call delete('Xwinminheight')
endfunc
" Test for the 'winminwidth' option " Test for the 'winminwidth' option
func Test_opt_winminwidth() func Test_opt_winminwidth()
only! only!

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2595,
/**/ /**/
2594, 2594,
/**/ /**/

View File

@@ -5860,8 +5860,8 @@ win_setminheight(void)
// loop until there is a 'winminheight' that is possible // loop until there is a 'winminheight' that is possible
while (p_wmh > 0) while (p_wmh > 0)
{ {
room = Rows - p_ch - tabline_height(); room = Rows - p_ch;
needed = frame_minheight(topframe, NULL); needed = min_rows() - 1; // 1 was added for the cmdline
if (room >= needed) if (room >= needed)
break; break;
--p_wmh; --p_wmh;