mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2560: setting 'winminheigt' does not take tabline into account
Problem: Setting 'winminheigt' does not take tabline into account. Solution: Subtract the tabline from the available height. (closes #7899)
This commit is contained in:
@@ -1015,6 +1015,26 @@ func Test_opt_winminheight()
|
|||||||
set winheight&
|
set winheight&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_opt_winminheight_term()
|
||||||
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
|
" The tabline should be taken into account.
|
||||||
|
let lines =<< trim END
|
||||||
|
set wmh=0 stal=2
|
||||||
|
below sp | wincmd _
|
||||||
|
below sp | wincmd _
|
||||||
|
below sp | wincmd _
|
||||||
|
below sp
|
||||||
|
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!
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
2560,
|
||||||
/**/
|
/**/
|
||||||
2559,
|
2559,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -5860,7 +5860,7 @@ 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;
|
room = Rows - p_ch - tabline_height();
|
||||||
needed = frame_minheight(topframe, NULL);
|
needed = frame_minheight(topframe, NULL);
|
||||||
if (room >= needed)
|
if (room >= needed)
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user