mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-patch:8.2.2467: script generated by :mkview changes alternate file
Problem: Script generated by :mkview changes alternate file.
Solution: Only write :balt in the session file. (Harish Rajagopal,
closes vim/vim#7779)
139348f3e8
This commit is contained in:
@@ -388,7 +388,8 @@ static int put_view(
|
|||||||
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 (alt != NULL && alt->b_fname != NULL && *alt->b_fname != NUL
|
if ((flagp == &ssop_flags) && alt != NULL && alt->b_fname != NULL
|
||||||
|
&& *alt->b_fname != NUL
|
||||||
&& (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;
|
||||||
|
@@ -317,6 +317,20 @@ func Test_mkview_open_folds()
|
|||||||
%bwipe
|
%bwipe
|
||||||
endfunc
|
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.
|
" 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.
|
||||||
|
Reference in New Issue
Block a user