vim-patch:8.1.0789: session sets v:errmsg #10553

Problem:    Sourcing a session sets v:errmsg.
Solution:   Use "%argdel" instead of "argdel *". (Jason Franklin)
555de4e3b2
This commit is contained in:
Jan Edmund Lazo 2019-07-20 13:06:17 -04:00 committed by Justin M. Keyes
parent b764120ee7
commit d20bbc8022
2 changed files with 12 additions and 1 deletions

View File

@ -9587,7 +9587,7 @@ ses_arglist(
if (fputs(cmd, fd) < 0 || put_eol(fd) == FAIL) {
return FAIL;
}
if (put_line(fd, "silent! argdel *") == FAIL) {
if (put_line(fd, "%argdel") == FAIL) {
return FAIL;
}
for (int i = 0; i < gap->ga_len; ++i) {

View File

@ -238,6 +238,17 @@ func Test_mkview_no_file_name()
%bwipe
endfunc
" A clean session (one empty buffer, one window, and one tab) should not
" set any error messages when sourced because no commands should fail.
func Test_mksession_no_errmsg()
let v:errmsg = ''
%bwipe!
mksession! Xtest_mks.out
source Xtest_mks.out
call assert_equal('', v:errmsg)
call delete('Xtest_mks.out')
endfunc
func Test_mksession_quote_in_filename()
if !has('unix')
" only Unix can handle this weird filename