diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-11 22:37:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 22:37:38 -0500 |
commit | 52397aaa0d1e2d4ce1320c73761cf316fc608ffb (patch) | |
tree | 647d32b73f0c9568acade1ed6e4d4e023c9c871b /src/nvim/ex_docmd.c | |
parent | 393095c1c69de922530871f74869433327b247b6 (diff) | |
parent | 4bc82a59b6fc3927ce20c7cadb080ed1c9d6fce8 (diff) | |
download | rneovim-52397aaa0d1e2d4ce1320c73761cf316fc608ffb.tar.gz rneovim-52397aaa0d1e2d4ce1320c73761cf316fc608ffb.tar.bz2 rneovim-52397aaa0d1e2d4ce1320c73761cf316fc608ffb.zip |
Merge pull request #13491 from seandewar/vim-8.2.1967
vim-patch:8.2.{1967,2058,2467}
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 6cc915c8c2..ef11107779 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7271,9 +7271,7 @@ static void ex_find(exarg_T *eap) } } -/* - * ":edit", ":badd", ":visual". - */ +/// ":edit", ":badd", ":balt", ":visual". static void ex_edit(exarg_T *eap) { do_exedit(eap, NULL); @@ -7347,7 +7345,9 @@ do_exedit( else if (eap->cmdidx == CMD_enew) readonlymode = FALSE; /* 'readonly' doesn't make sense in an empty buffer */ - setpcmark(); + if (eap->cmdidx != CMD_balt && eap->cmdidx != CMD_badd) { + setpcmark(); + } if (do_ecmd(0, (eap->cmdidx == CMD_enew ? NULL : eap->arg), NULL, eap, eap->do_ecmd_lnum, (buf_hide(curbuf) ? ECMD_HIDE : 0) @@ -7355,6 +7355,7 @@ do_exedit( // After a split we can use an existing buffer. + (old_curwin != NULL ? ECMD_OLDBUF : 0) + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0) + + (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0) , old_curwin == NULL ? curwin : NULL) == FAIL) { // Editing the file failed. If the window was split, close it. if (old_curwin != NULL) { @@ -8725,7 +8726,7 @@ ssize_t find_cmdline_var(const char_u *src, size_t *usedlen) * Evaluate cmdline variables. * * change '%' to curbuf->b_ffname - * '#' to curwin->w_altfile + * '#' to curwin->w_alt_fnum * '<cword>' to word under the cursor * '<cWORD>' to WORD under the cursor * '<cexpr>' to C-expression under the cursor |