Patch 9.0.0506
Problem:    Line number argument for :badd does not work.
Solution:   Set the last cursor position in the new buffer. (closes #11161)
Files:      src/ex_cmds.c, src/testdir/test_buffer.vim


*** ../vim-9.0.0505/src/ex_cmds.c       2022-09-17 21:07:52.095993168 +0100
--- src/ex_cmds.c       2022-09-19 18:18:50.004064002 +0100
***************
*** 2651,2658 ****
                // 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;
                goto theend;
            }
            buf = buflist_new(ffname, sfname, 0L,
--- 2651,2663 ----
                // with the current window.
                newbuf = buflist_new(ffname, sfname, tlnum,
                                                    BLN_LISTED | BLN_NOCURWIN);
!               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,
*** ../vim-9.0.0505/src/testdir/test_buffer.vim 2022-09-08 12:27:58.281556519 
+0100
--- src/testdir/test_buffer.vim 2022-09-19 18:17:30.700254431 +0100
***************
*** 361,366 ****
--- 361,373 ----
    close
    close
    bwipe! SomeNewBuffer
+ 
+   badd +3 XbaddFile
+   call writefile(range(6), 'XbaddFile', 'D')
+   buf XbaddFile
+   call assert_equal([0, 3, 1, 0], getpos('.'))
+ 
+   bwipe! XbaddFile
  endfunc
  
  func Test_balt()
*** ../vim-9.0.0505/src/version.c       2022-09-19 16:45:26.202239861 +0100
--- src/version.c       2022-09-19 17:27:54.095645988 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     506,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
92. It takes you two hours to check all 14 of your mailboxes.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220919172044.DF5DA1C0846%40moolenaar.net.

Raspunde prin e-mail lui