summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 9fdbe955e0..265927c4cd 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2651,8 +2651,13 @@ do_ecmd(
// with the current window.
newbuf = buflist_new(ffname, sfname, tlnum,
BLN_LISTED | BLN_NOCURWIN);
- if (newbuf != NULL && (flags & ECMD_ALTBUF))
- curwin->w_alt_fnum = newbuf->b_fnum;
+ if (newbuf != NULL)
+ {
+ if (flags & ECMD_ALTBUF)
+ curwin->w_alt_fnum = newbuf->b_fnum;
+ if (tlnum > 0)
+ newbuf->b_last_cursor.lnum = tlnum;
+ }
goto theend;
}
buf = buflist_new(ffname, sfname, 0L,