summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index b536be64bf..a4afe132e0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -428,7 +428,10 @@ can_unload_buffer(buf_T *buf)
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer == buf)
+ {
can_unload = FALSE;
+ break;
+ }
}
if (!can_unload)
EMSG(_("E937: Attempt to delete a buffer that is in use"));
@@ -1742,6 +1745,9 @@ enter_buffer(buf_T *buf)
/* mark cursor position as being invalid */
curwin->w_valid = 0;
+ buflist_setfpos(curbuf, curwin, curbuf->b_last_cursor.lnum,
+ curbuf->b_last_cursor.col, TRUE);
+
/* Make sure the buffer is loaded. */
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
{