mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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 vim/vim#7951)0756f757ed
N/A patches for version.c: vim-patch:8.2.2593: list of distributed files is incomplete Problem: List of distributed files is incomplete. Solution: Add a file and rename another.0de8e2d6a3
This commit is contained in:
parent
5d5e018a5c
commit
60670c1fd3
@ -387,9 +387,10 @@ static int put_view(
|
|||||||
if (wp->w_alt_fnum) {
|
if (wp->w_alt_fnum) {
|
||||||
buf_T *const alt = buflist_findnr(wp->w_alt_fnum);
|
buf_T *const 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
|
if ((flagp == &ssop_flags) && alt != NULL && alt->b_fname != NULL
|
||||||
&& *alt->b_fname != NUL
|
&& *alt->b_fname != NUL
|
||||||
|
&& alt->b_p_bl
|
||||||
&& (fputs("balt ", fd) < 0
|
&& (fputs("balt ", fd) < 0
|
||||||
|| ses_fname(fd, alt, flagp, true) == FAIL)) {
|
|| ses_fname(fd, alt, flagp, true) == FAIL)) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -331,6 +331,20 @@ func Test_mkview_no_balt()
|
|||||||
%bwipe
|
%bwipe
|
||||||
endfunc
|
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.
|
" Test :mkview with a file argument.
|
||||||
func Test_mkview_file()
|
func Test_mkview_file()
|
||||||
" Create a view with line number and a fold.
|
" Create a view with line number and a fold.
|
||||||
|
Loading…
Reference in New Issue
Block a user