From ec1561cac59006213dd5405d164a94dc7d002806 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 17 Jun 2014 13:52:40 +0200 Subject: [PATCH] updated for version 7.4.329 Problem: When moving the cursor and then switching to another window the previous window isn't scrolled. (Yukihiro Nakadaira) Solution: Call update_topline() before leaving the window. (Christian Brabandt) --- src/version.c | 2 ++ src/window.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/version.c b/src/version.c index f25abaeee7..b60a8213fe 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 329, /**/ 328, /**/ diff --git a/src/window.c b/src/window.c index 4a0ed23c78..5215bb8e51 100644 --- a/src/window.c +++ b/src/window.c @@ -4250,6 +4250,11 @@ win_enter_ext(wp, undo_sync, curwin_invalid, trigger_enter_autocmds, trigger_lea /* sync undo before leaving the current buffer */ if (undo_sync && curbuf != wp->w_buffer) u_sync(FALSE); + + /* Might need to scroll the old window before switching, e.g., when the + * cursor was moved. */ + update_topline(); + /* 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);