summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-03-13 13:52:33 +0100
committerBram Moolenaar <Bram@vim.org>2021-03-13 13:52:33 +0100
commit0756f757edba755b75e0c9c612ab2f7e673def84 (patch)
tree16cb463550e90a09bc3788cf47fadaa39ab36047 /src/session.c
parent0de8e2d6a3fae61c4d9dfdd6f16fc5040d994f6c (diff)
downloadvim-git-0756f757edba755b75e0c9c612ab2f7e673def84.tar.gz
patch 8.2.2594: alternate buffer added to session file even when it's hiddenv8.2.2594
Problem: Alternate buffer added to session file even when it's hidden. Solution: Check the 'buflisted' option. (closes #7951)
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/session.c b/src/session.c
index a734656d5..6e73bb676 100644
--- a/src/session.c
+++ b/src/session.c
@@ -401,11 +401,12 @@ put_view(
{
buf_T *alt = buflist_findnr(wp->w_alt_fnum);
- // Set the alternate file.
+ // Set the alternate file if the buffer is listed.
if ((flagp == &ssop_flags)
&& alt != NULL
&& alt->b_fname != NULL
&& *alt->b_fname != NUL
+ && alt->b_p_bl
&& (fputs("balt ", fd) < 0
|| ses_fname(fd, alt, flagp, TRUE) == FAIL))
return FAIL;