summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-11-15 15:06:17 +0000
committerBram Moolenaar <Bram@vim.org>2008-11-15 15:06:17 +0000
commitd4153d4a62172ecb451020e9b90b3fe5b0e7e8be (patch)
treea409d964f846c19fe64a3a39196b17ecfe80e6ba /src/buffer.c
parent701f7afcdf5f510090116a6a6fa91ca479c88e06 (diff)
updated for version 7.2-042v7.2.042
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4104977d67..741de4887a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1401,6 +1401,9 @@ enter_buffer(buf)
curwin->w_cursor.coladd = 0;
#endif
curwin->w_set_curswant = TRUE;
+#ifdef FEAT_AUTOCMD
+ curwin->w_topline_was_set = FALSE;
+#endif
/* Make sure the buffer is loaded. */
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
@@ -1440,7 +1443,8 @@ enter_buffer(buf)
maketitle();
#endif
#ifdef FEAT_AUTOCMD
- if (curwin->w_topline == 1) /* when autocmds didn't change it */
+ /* when autocmds didn't change it */
+ if (curwin->w_topline == 1 && !curwin->w_topline_was_set)
#endif
scroll_cursor_halfway(FALSE); /* redisplay at correct position */