Patch 8.2.1902
Problem:    Default option values are changed when using :badd for an existing
            buffer.
Solution:   When calling buflist_new() pass a zero line number. (closes #7195)
Files:      src/ex_cmds.c, src/testdir/test_buffer.vim


*** ../vim-8.2.1901/src/ex_cmds.c       2020-10-24 20:58:02.533121768 +0200
--- src/ex_cmds.c       2020-10-25 15:02:03.587990281 +0100
***************
*** 2630,2636 ****
        {
            if (flags & ECMD_ADDBUF)
            {
!               linenr_T        tlnum = 1L;
  
                if (command != NULL)
                {
--- 2630,2638 ----
        {
            if (flags & ECMD_ADDBUF)
            {
!               // Default the line number to zero to avoid that a wininfo item
!               // is added for the current window.
!               linenr_T        tlnum = 0;
  
                if (command != NULL)
                {
*** ../vim-8.2.1901/src/testdir/test_buffer.vim 2020-09-23 22:38:01.503927513 
+0200
--- src/testdir/test_buffer.vim 2020-10-25 15:01:08.028144725 +0100
***************
*** 362,365 ****
--- 362,377 ----
    %bw!
  endfunc
  
+ func Test_badd_options()
+   new SomeNewBuffer
+   setlocal cole=3
+   wincmd p
+   badd SomeNewBuffer
+   new SomeNewBuffer
+   call assert_equal(3, &cole)
+   close
+   close
+   bwipe! SomeNewBuffer
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.1901/src/version.c       2020-10-25 13:22:38.216253317 +0100
--- src/version.c       2020-10-25 15:02:36.103899945 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1902,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
126. You brag to all of your friends about your date Saturday night...but
     you don't tell them it was only in a chat room.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202010251403.09PE3RI41295669%40masaka.moolenaar.net.

Raspunde prin e-mail lui