mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
fix(autocmd): 'cmdheight' OptionSet with valid window grids (#34619)
Problem: OptionSet autocmd emitted with invalid grids after entering tabpage with different 'cmdheight'. Solution: First call `tabpage_check_windows()` before changing 'cmdheight'. Add a test that exercises the `vim._extui` cmdline.
This commit is contained in:
@ -4441,18 +4441,17 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
|
||||
|
||||
use_tabpage(tp);
|
||||
|
||||
if (p_ch != curtab->tp_ch_used) {
|
||||
// Use the stored value of p_ch, so that it can be different for each tab page.
|
||||
// Handle other side-effects but avoid setting frame sizes, which are still correct.
|
||||
OptInt new_ch = curtab->tp_ch_used;
|
||||
curtab->tp_ch_used = p_ch;
|
||||
command_frame_height = false;
|
||||
set_option_value(kOptCmdheight, NUMBER_OPTVAL(new_ch), 0);
|
||||
command_frame_height = true;
|
||||
}
|
||||
|
||||
if (old_curtab != curtab) {
|
||||
tabpage_check_windows(old_curtab);
|
||||
if (p_ch != curtab->tp_ch_used) {
|
||||
// Use the stored value of p_ch, so that it can be different for each tab page.
|
||||
// Handle other side-effects but avoid setting frame sizes, which are still correct.
|
||||
OptInt new_ch = curtab->tp_ch_used;
|
||||
curtab->tp_ch_used = p_ch;
|
||||
command_frame_height = false;
|
||||
set_option_value(kOptCmdheight, NUMBER_OPTVAL(new_ch), 0);
|
||||
command_frame_height = true;
|
||||
}
|
||||
}
|
||||
|
||||
// We would like doing the TabEnter event first, but we don't have a
|
||||
|
Reference in New Issue
Block a user