summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-06-17 13:52:40 +0200
committerBram Moolenaar <Bram@vim.org>2014-06-17 13:52:40 +0200
commitec1561cac59006213dd5405d164a94dc7d002806 (patch)
tree4484b8f4ea4c5c3368fb98c77296b0b0d4c47407 /src/window.c
parent7a54a90744529ab4d3291fa5cdf7656184b8469c (diff)
downloadvim-git-ec1561cac59006213dd5405d164a94dc7d002806.tar.gz
updated for version 7.4.329v7.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)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 4a0ed23c7..5215bb8e5 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);