Problem: Cursor is not adjusted when 'cmdheight' is changed to cover
the cursor with 'splitkeep' ~= "cursor".
Solution: Handle window resize for 'splitkeep' after changing 'cmdheight'.
Ensure previous window height is set when changing 'splitkeep'
(Luuk van Baal).
closes: #20043
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
char *
did_set_splitkeep(optset_T *args UNUSED)
{
+ win_T *wp;
+ tabpage_T *tp;
+ FOR_ALL_TAB_WINDOWS(tp, wp)
+ wp->w_prev_height = wp->w_height;
return did_set_opt_strings(p_spk, p_spk_values, FALSE);
}
set splitkeep&
endfunc
+func Test_splitkeep_cmdheight()
+ set splitkeep=screen
+ call setline(1, range(&lines))
+ norm! G
+ set cmdheight=2
+ call assert_equal(&lines - 1, line('.'))
+ %bwipeout!
+ set splitkeep& cmdheight&
+endfunc
+
func Test_splitkeep_cursor()
CheckScreendump
let lines =<< trim END
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 413,
/**/
412,
/**/
}
if (p_ch < old_p_ch && command_frame_height && frp != NULL)
frame_add_height(frp, (int)(old_p_ch - p_ch));
+ win_fix_scroll(true);
// Recompute window positions.
win_comp_pos();