Mercurial > vim
diff src/ex_docmd.c @ 22840:7c1e2e3f2d8d v8.2.1967
patch 8.2.1967: the session file does not restore the alternate file
Commit: https://github.com/vim/vim/commit/59d8e56e048eb5d384649284fb35363931fc3697
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 7 18:41:10 2020 +0100
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 #7269,
closes #6714)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 Nov 2020 18:45:04 +0100 |
parents | 44317eb799d7 |
children | 6d50182e7e24 |
line wrap: on
line diff
--- 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 *usedl * 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