0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0506: line number argument for :badd does not work

Problem:    Line number argument for :badd does not work.
Solution:   Set the last cursor position in the new buffer. (closes #11161)
This commit is contained in:
Bram Moolenaar
2022-09-19 18:20:08 +01:00
parent faf1d412f5
commit a2b91036d1
3 changed files with 16 additions and 2 deletions

View File

@@ -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,