aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-02-14 11:36:12 -0500
committerGitHub <noreply@github.com>2021-02-14 11:36:12 -0500
commitdc3ca16a99ec05c88df1b1fe6a3cfbe97ea34227 (patch)
treee193cb9ffc5ee85682e13c8fa82848140f6ef949 /src/nvim/ex_cmds.c
parent96ca0e2142d4256e7d12f63e4e0ea1474ea28922 (diff)
parent147d40f2a0306df7617812ae83f7225a1b86ad1d (diff)
downloadrneovim-dc3ca16a99ec05c88df1b1fe6a3cfbe97ea34227.tar.gz
rneovim-dc3ca16a99ec05c88df1b1fe6a3cfbe97ea34227.tar.bz2
rneovim-dc3ca16a99ec05c88df1b1fe6a3cfbe97ea34227.zip
Merge pull request #13930 from janlazo/vim-8.2.1902
vim-patch:8.2.{54,64,576,925,1056,1058,1902,1903,1904}
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index a994d0d8c3..b220b034dd 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2324,15 +2324,19 @@ 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);
if (tlnum <= 0)
tlnum = 1L;
}
+ // Add BLN_NOCURWIN to avoid a new wininfo items are associated
+ // with the current window.
const buf_T *const newbuf
- = buflist_new(ffname, sfname, tlnum, BLN_LISTED);
+ = buflist_new(ffname, sfname, tlnum, BLN_LISTED | BLN_NOCURWIN);
if (newbuf != NULL && (flags & ECMD_ALTBUF)) {
curwin->w_alt_fnum = newbuf->b_fnum;
}