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)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 82e9c57..a9be36a 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2630,7 +2630,9 @@
{
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)
{