aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-02-13 13:34:43 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-02-13 13:40:09 -0500
commit9860d14af367be03c9588beb39edf37c16c84375 (patch)
tree62187163be15b3445b779b2356dfea382f63dc79 /src/nvim/ex_cmds.c
parent5ad32885d461e8ace052397b251f25fae24189a3 (diff)
downloadrneovim-9860d14af367be03c9588beb39edf37c16c84375.tar.gz
rneovim-9860d14af367be03c9588beb39edf37c16c84375.tar.bz2
rneovim-9860d14af367be03c9588beb39edf37c16c84375.zip
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) https://github.com/vim/vim/commit/e974fa7b2b98e53a59d5ef16a6a1291f12a32e33
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index a994d0d8c3..bf9fc6f187 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -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);