Patch 8.2.2594
Problem: Alternate buffer added to session file even when it's hidden.
Solution: Check the 'buflisted' option. (closes #7951)
Files: src/session.c, src/testdir/test_mksession.vim
*** ../vim-8.2.2593/src/session.c 2021-02-05 21:55:47.991995220 +0100
--- src/session.c 2021-03-13 13:51:59.037536433 +0100
***************
*** 401,411 ****
{
buf_T *alt = buflist_findnr(wp->w_alt_fnum);
! // Set the alternate file.
if ((flagp == &ssop_flags)
&& alt != NULL
&& alt->b_fname != NULL
&& *alt->b_fname != NUL
&& (fputs("balt ", fd) < 0
|| ses_fname(fd, alt, flagp, TRUE) == FAIL))
return FAIL;
--- 401,412 ----
{
buf_T *alt = buflist_findnr(wp->w_alt_fnum);
! // 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;
*** ../vim-8.2.2593/src/testdir/test_mksession.vim 2021-02-05
21:55:47.991995220 +0100
--- src/testdir/test_mksession.vim 2021-03-13 13:51:37.485581864 +0100
***************
*** 544,549 ****
--- 544,563 ----
%bwipe
endfunc
+ func Test_mksession_no_balt()
+ edit Xtestfile1
+ edit Xtestfile2
+
+ bdelete Xtestfile1
+ mksession! Xtestview
+
+ source Xtestview
+ call assert_equal(0, buflisted('Xtestfile1'))
+
+ call delete('Xtestview')
+ %bwipe
+ endfunc
+
" Test :mkview with a file argument.
func Test_mkview_file()
" Create a view with line number and a fold.
*** ../vim-8.2.2593/src/version.c 2021-03-13 13:30:00.139449053 +0100
--- src/version.c 2021-03-13 13:47:32.362068175 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2594,
/**/
--
CRONE: Who sent you?
ARTHUR: The Knights Who Say GNU!
CRONE: Aaaagh! (she looks around in rear) No! We have no licenses here.
"Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202103131253.12DCrBxk4163143%40masaka.moolenaar.net.