comparison 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
comparison
equal deleted inserted replaced
22839:5a6b1d00c97e 22840:7c1e2e3f2d8d
6504 eap->cmdidx = CMD_visual; 6504 eap->cmdidx = CMD_visual;
6505 do_exedit(eap, NULL); 6505 do_exedit(eap, NULL);
6506 } 6506 }
6507 6507
6508 /* 6508 /*
6509 * ":edit", ":badd", ":visual". 6509 * ":edit", ":badd", ":balt", ":visual".
6510 */ 6510 */
6511 static void 6511 static void
6512 ex_edit(exarg_T *eap) 6512 ex_edit(exarg_T *eap)
6513 { 6513 {
6514 do_exedit(eap, NULL); 6514 do_exedit(eap, NULL);
6619 ? ECMD_ONE : eap->do_ecmd_lnum, 6619 ? ECMD_ONE : eap->do_ecmd_lnum,
6620 (buf_hide(curbuf) ? ECMD_HIDE : 0) 6620 (buf_hide(curbuf) ? ECMD_HIDE : 0)
6621 + (eap->forceit ? ECMD_FORCEIT : 0) 6621 + (eap->forceit ? ECMD_FORCEIT : 0)
6622 // after a split we can use an existing buffer 6622 // after a split we can use an existing buffer
6623 + (old_curwin != NULL ? ECMD_OLDBUF : 0) 6623 + (old_curwin != NULL ? ECMD_OLDBUF : 0)
6624 + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 ) 6624 + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0)
6625 + (eap->cmdidx == CMD_balt ? ECMD_ALTBUF : 0)
6625 , old_curwin == NULL ? curwin : NULL) == FAIL) 6626 , old_curwin == NULL ? curwin : NULL) == FAIL)
6626 { 6627 {
6627 // Editing the file failed. If the window was split, close it. 6628 // Editing the file failed. If the window was split, close it.
6628 if (old_curwin != NULL) 6629 if (old_curwin != NULL)
6629 { 6630 {
8470 8471
8471 /* 8472 /*
8472 * Evaluate cmdline variables. 8473 * Evaluate cmdline variables.
8473 * 8474 *
8474 * change '%' to curbuf->b_ffname 8475 * change '%' to curbuf->b_ffname
8475 * '#' to curwin->w_altfile 8476 * '#' to curwin->w_alt_fnum
8476 * '<cword>' to word under the cursor 8477 * '<cword>' to word under the cursor
8477 * '<cWORD>' to WORD under the cursor 8478 * '<cWORD>' to WORD under the cursor
8478 * '<cexpr>' to C-expression under the cursor 8479 * '<cexpr>' to C-expression under the cursor
8479 * '<cfile>' to path name under the cursor 8480 * '<cfile>' to path name under the cursor
8480 * '<sfile>' to sourced file name 8481 * '<sfile>' to sourced file name