mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
@@ -2651,8 +2651,13 @@ do_ecmd(
|
|||||||
// with the current window.
|
// with the current window.
|
||||||
newbuf = buflist_new(ffname, sfname, tlnum,
|
newbuf = buflist_new(ffname, sfname, tlnum,
|
||||||
BLN_LISTED | BLN_NOCURWIN);
|
BLN_LISTED | BLN_NOCURWIN);
|
||||||
if (newbuf != NULL && (flags & ECMD_ALTBUF))
|
if (newbuf != NULL)
|
||||||
curwin->w_alt_fnum = newbuf->b_fnum;
|
{
|
||||||
|
if (flags & ECMD_ALTBUF)
|
||||||
|
curwin->w_alt_fnum = newbuf->b_fnum;
|
||||||
|
if (tlnum > 0)
|
||||||
|
newbuf->b_last_cursor.lnum = tlnum;
|
||||||
|
}
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
buf = buflist_new(ffname, sfname, 0L,
|
buf = buflist_new(ffname, sfname, 0L,
|
||||||
|
@@ -361,6 +361,13 @@ func Test_badd_options()
|
|||||||
close
|
close
|
||||||
close
|
close
|
||||||
bwipe! SomeNewBuffer
|
bwipe! SomeNewBuffer
|
||||||
|
|
||||||
|
badd +3 XbaddFile
|
||||||
|
call writefile(range(6), 'XbaddFile', 'D')
|
||||||
|
buf XbaddFile
|
||||||
|
call assert_equal([0, 3, 1, 0], getpos('.'))
|
||||||
|
|
||||||
|
bwipe! XbaddFile
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_balt()
|
func Test_balt()
|
||||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
506,
|
||||||
/**/
|
/**/
|
||||||
505,
|
505,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user