mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 17:06:30 +00:00
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. (vim/vim#7899)
9e813b3dea
This commit is contained in:
@@ -634,6 +634,28 @@ func Test_opt_winminheight_term()
|
||||
call delete('Xwinminheight')
|
||||
endfunc
|
||||
|
||||
func Test_opt_winminheight_term_tabs()
|
||||
" See test/functional/legacy/options_spec.lua
|
||||
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 setting option value containing spaces with isfname+=32
|
||||
func Test_isfname_with_options()
|
||||
set isfname+=32
|
||||
|
@@ -5501,8 +5501,8 @@ void win_setminheight(void)
|
||||
|
||||
// loop until there is a 'winminheight' that is possible
|
||||
while (p_wmh > 0) {
|
||||
const int room = Rows - p_ch - tabline_height();
|
||||
const int needed = frame_minheight(topframe, NULL);
|
||||
const int room = Rows - p_ch;
|
||||
const int needed = min_rows() - 1; // 1 was added for the cmdline
|
||||
if (room >= needed) {
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user