mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
fix(ui): wincmd _ should not increase 'cmdheight' above 0 (#33056)
This commit is contained in:
@@ -196,6 +196,10 @@ win_T *swbuf_goto_win_with_buf(buf_T *buf)
|
|||||||
return wp;
|
return wp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 'cmdheight' value explicitly set by the user: window commands are allowed to
|
||||||
|
// resize the topframe to values higher than this minimum, but not lower.
|
||||||
|
static OptInt min_set_ch = 1;
|
||||||
|
|
||||||
/// all CTRL-W window commands are handled here, called from normal_cmd().
|
/// all CTRL-W window commands are handled here, called from normal_cmd().
|
||||||
///
|
///
|
||||||
/// @param xchar extra char from ":wincmd gx" or NUL
|
/// @param xchar extra char from ":wincmd gx" or NUL
|
||||||
@@ -513,7 +517,7 @@ newwindow:
|
|||||||
// set current window height
|
// set current window height
|
||||||
case Ctrl__:
|
case Ctrl__:
|
||||||
case '_':
|
case '_':
|
||||||
win_setheight(Prenum ? Prenum : Rows - 1);
|
win_setheight(Prenum ? Prenum : Rows - (int)min_set_ch);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// increase current window width
|
// increase current window width
|
||||||
@@ -3505,10 +3509,6 @@ static bool is_bottom_win(win_T *wp)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'cmdheight' value explicitly set by the user: window commands are allowed to
|
|
||||||
// resize the topframe to values higher than this minimum, but not lower.
|
|
||||||
static OptInt min_set_ch = 1;
|
|
||||||
|
|
||||||
/// Set a new height for a frame. Recursively sets the height for contained
|
/// Set a new height for a frame. Recursively sets the height for contained
|
||||||
/// frames and windows. Caller must take care of positions.
|
/// frames and windows. Caller must take care of positions.
|
||||||
///
|
///
|
||||||
|
@@ -1352,6 +1352,12 @@ describe('cmdline height', function()
|
|||||||
-- cmdheight unchanged.
|
-- cmdheight unchanged.
|
||||||
eq(1, eval('&cmdheight'))
|
eq(1, eval('&cmdheight'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('not increased to 0 from 1 with wincmd _', function()
|
||||||
|
command('set cmdheight=0 laststatus=0')
|
||||||
|
command('wincmd _')
|
||||||
|
eq(0, eval('&cmdheight'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('cmdheight=0', function()
|
describe('cmdheight=0', function()
|
||||||
|
Reference in New Issue
Block a user