diff src/session.c @ 24106:3b5d499c2bb5 v8.2.2594

patch 8.2.2594: alternate buffer added to session file even when it's hidden Commit: https://github.com/vim/vim/commit/0756f757edba755b75e0c9c612ab2f7e673def84 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 13 13:52:33 2021 +0100 patch 8.2.2594: alternate buffer added to session file even when it's hidden Problem: Alternate buffer added to session file even when it's hidden. Solution: Check the 'buflisted' option. (closes https://github.com/vim/vim/issues/7951)
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Mar 2021 14:00:04 +0100
parents a2f13e56b0e7
children a56f9c2ba51c
line wrap: on
line diff
--- 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;