Skip to content

Commit 3735f11

Browse files
luukvbaalbrammool
authored andcommitted
patch 9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off
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)
1 parent aeef1f7 commit 3735f11

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

src/ex_getln.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4405,7 +4405,6 @@ open_cmdwin(void)
44054405
int save_restart_edit = restart_edit;
44064406
int save_State = State;
44074407
int save_exmode = exmode_active;
4408-
int save_p_spsc;
44094408
#ifdef FEAT_RIGHTLEFT
44104409
int save_cmdmsg_rl = cmdmsg_rl;
44114410
#endif
@@ -4645,10 +4644,8 @@ open_cmdwin(void)
46454644
wp = curwin;
46464645
set_bufref(&bufref, curbuf);
46474646

4648-
save_p_spsc = p_spsc;
4649-
p_spsc = TRUE;
4647+
skip_win_fix_cursor = TRUE;
46504648
win_goto(old_curwin);
4651-
p_spsc = save_p_spsc;
46524649

46534650
// win_goto() may trigger an autocommand that already closes the
46544651
// cmdline window.
@@ -4662,6 +4659,7 @@ open_cmdwin(void)
46624659

46634660
// Restore window sizes.
46644661
win_size_restore(&winsizes);
4662+
skip_win_fix_cursor = FALSE;
46654663
}
46664664

46674665
ga_clear(&winsizes);

src/globals.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,3 +1737,8 @@ EXTERN int channel_need_redraw INIT(= FALSE);
17371737
// While executing a regexp and set to OPTION_MAGIC_ON or OPTION_MAGIC_OFF this
17381738
// overrules p_magic. Otherwise set to OPTION_MAGIC_NOT_SET.
17391739
EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET);
1740+
1741+
#ifdef FEAT_CMDWIN
1742+
// Skip win_fix_cursor() call for 'nosplitscroll' when cmdwin is closed.
1743+
EXTERN int skip_win_fix_cursor INIT(= FALSE);
1744+
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ static char *(features[]) =
703703

704704
static int included_patches[] =
705705
{ /* Add new patch number below this line */
706+
/**/
707+
469,
706708
/**/
707709
468,
708710
/**/

src/window.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6410,6 +6410,10 @@ win_fix_cursor(int normal)
64106410

64116411
if (wp->w_buffer->b_ml.ml_line_count < wp->w_height)
64126412
return;
6413+
#ifdef FEAT_CMDWIN
6414+
if (skip_win_fix_cursor)
6415+
return;
6416+
#endif
64136417

64146418
so = MIN(wp->w_height / 2, so);
64156419
// Check if cursor position is above topline or below botline.

0 commit comments

Comments
 (0)