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 vim/vim#7195)
e974fa7b2b
This commit is contained in:
Jan Edmund Lazo
2021-02-13 13:34:43 -05:00
parent 5ad32885d4
commit 9860d14af3
2 changed files with 15 additions and 1 deletions

View File

@@ -2324,7 +2324,9 @@ int do_ecmd(
buf = buflist_findnr(fnum);
} else {
if (flags & (ECMD_ADDBUF | ECMD_ALTBUF)) {
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) {
tlnum = atol((char *)command);