To: vim_dev@googlegroups.com Subject: Patch 8.2.1902 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- 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 ///