mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
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)
59d8e56e04
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user