summaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 9f80657124..54e17be2db 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5381,11 +5381,15 @@ win_enter_ext(win_T *wp, int flags)
// may have to copy the buffer options when 'cpo' contains 'S'
if (wp->w_buffer != curbuf)
buf_copy_options(wp->w_buffer, BCO_ENTER | BCO_NOHELP);
+
if (curwin_invalid == 0)
{
prevwin = curwin; // remember for CTRL-W p
curwin->w_redr_status = TRUE;
}
+ else if (wp == prevwin)
+ prevwin = NULL; // don't want it to be the new curwin
+
curwin = wp;
curbuf = wp->w_buffer;
check_cursor();