diff --git a/src/session.c b/src/session.c index d0373bb394..a734656d54 100644 --- a/src/session.c +++ b/src/session.c @@ -402,7 +402,8 @@ put_view( buf_T *alt = buflist_findnr(wp->w_alt_fnum); // Set the alternate file. - if (alt != NULL + if ((flagp == &ssop_flags) + && alt != NULL && alt->b_fname != NULL && *alt->b_fname != NUL && (fputs("balt ", fd) < 0 diff --git a/src/testdir/test_mksession.vim b/src/testdir/test_mksession.vim index 82c96ce639..eb8c6a5a46 100644 --- a/src/testdir/test_mksession.vim +++ b/src/testdir/test_mksession.vim @@ -530,6 +530,20 @@ func Test_mkview_open_folds() %bwipe endfunc +func Test_mkview_no_balt() + edit Xtestfile1 + edit Xtestfile2 + + mkview! Xtestview + bdelete Xtestfile1 + + 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. diff --git a/src/version.c b/src/version.c index 0ea7fb4493..df206d1ccb 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2467, /**/ 2466, /**/