Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off.
Solution: Skip win_fix_cursor if called when cmdwin is open or closing.
(Luuk van Baal, closes #11134)
int save_restart_edit = restart_edit;
int save_State = State;
int save_exmode = exmode_active;
- int save_p_spsc;
#ifdef FEAT_RIGHTLEFT
int save_cmdmsg_rl = cmdmsg_rl;
#endif
wp = curwin;
set_bufref(&bufref, curbuf);
- save_p_spsc = p_spsc;
- p_spsc = TRUE;
+ skip_win_fix_cursor = TRUE;
win_goto(old_curwin);
- p_spsc = save_p_spsc;
// win_goto() may trigger an autocommand that already closes the
// cmdline window.
// Restore window sizes.
win_size_restore(&winsizes);
+ skip_win_fix_cursor = FALSE;
}
ga_clear(&winsizes);
// While executing a regexp and set to OPTION_MAGIC_ON or OPTION_MAGIC_OFF this
// overrules p_magic. Otherwise set to OPTION_MAGIC_NOT_SET.
EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET);
+
+#ifdef FEAT_CMDWIN
+// Skip win_fix_cursor() call for 'nosplitscroll' when cmdwin is closed.
+EXTERN int skip_win_fix_cursor INIT(= FALSE);
+#endif
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 469,
/**/
468,
/**/
if (wp->w_buffer->b_ml.ml_line_count < wp->w_height)
return;
+#ifdef FEAT_CMDWIN
+ if (skip_win_fix_cursor)
+ return;
+#endif
so = MIN(wp->w_height / 2, so);
// Check if cursor position is above topline or below botline.