aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2020-12-07 18:35:03 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2021-02-11 19:00:24 +0000
commitd9dd360d2aff7d3e1580367692c83fcd3647a439 (patch)
tree56f55f3eb6c9af12893d8ed8c2c728a04160e2ae /src/nvim/ex_docmd.c
parent1aec5ba85e97889c792253424c5de9c12ddd6cf4 (diff)
downloadrneovim-d9dd360d2aff7d3e1580367692c83fcd3647a439.tar.gz
rneovim-d9dd360d2aff7d3e1580367692c83fcd3647a439.tar.bz2
rneovim-d9dd360d2aff7d3e1580367692c83fcd3647a439.zip
vim-patch:8.2.1967: the session file does not restore the alternate file
Problem: The session file does not restore the alternate file. Solution: Add ":balt". Works like ":badd" and also sets the buffer as the alternate file. Use it in the session file. (closes vim/vim#7269, closes vim/vim#6714) https://github.com/vim/vim/commit/59d8e56e048eb5d384649284fb35363931fc3697 Include minimal test_buffer.vim from patch 8.2.0243 for Test_balt(). Add entry for :balt to runtime/doc/index.txt from vim/vim#7819.
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 6cc915c8c2..781b110b1c 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);
@@ -7355,6 +7353,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 +8724,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