1
0
forked from aniani/vim

patch 8.2.1902: default option values changed with :badd for existing buffer

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)
This commit is contained in:
Bram Moolenaar
2020-10-25 15:02:51 +01:00
parent 4ff2f2fb6b
commit e974fa7b2b
3 changed files with 17 additions and 1 deletions

View File

@@ -2630,7 +2630,9 @@ do_ecmd(
{ {
if (flags & ECMD_ADDBUF) if (flags & ECMD_ADDBUF)
{ {
linenr_T tlnum = 1L; // 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) if (command != NULL)
{ {

View File

@@ -362,4 +362,16 @@ func Test_sball_with_count()
%bw! %bw!
endfunc 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: shiftwidth=2 sts=2 expandtab

View File

@@ -750,6 +750,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 */
/**/
1902,
/**/ /**/
1901, 1901,
/**/ /**/