summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-07 18:41:10 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-07 18:41:10 +0100
commit59d8e56e048eb5d384649284fb35363931fc3697 (patch)
tree3941971859628440195075acf6104cac9ef43821 /src/ex_docmd.c
parentcbcd9cbd77acc8cc97c0d44683d96c01d3dd0fa7 (diff)
downloadvim-git-59d8e56e048eb5d384649284fb35363931fc3697.tar.gz
patch 8.2.1967: the session file does not restore the alternate filev8.2.1967
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 #7269, closes #6714)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 290dcee26..627dae71e 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6506,7 +6506,7 @@ ex_open(exarg_T *eap)
}
/*
- * ":edit", ":badd", ":visual".
+ * ":edit", ":badd", ":balt", ":visual".
*/
static void
ex_edit(exarg_T *eap)
@@ -6621,7 +6621,8 @@ do_exedit(
+ (eap->forceit ? ECMD_FORCEIT : 0)
// 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_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.
@@ -8472,7 +8473,7 @@ find_cmdline_var(char_u *src, int *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