Skip to content

Commit 555de4e

Browse files
committed
patch 8.1.0789: sourcing a session sets v:errmsg
Problem: Sourcing a session sets v:errmsg. Solution: Use "%argdel" instead of "argdel *". (Jason Franklin)
1 parent b2148f5 commit 555de4e

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12007,7 +12007,7 @@ ses_arglist(
1200712007

1200812008
if (fputs(cmd, fd) < 0 || put_eol(fd) == FAIL)
1200912009
return FAIL;
12010-
if (put_line(fd, "silent! argdel *") == FAIL)
12010+
if (put_line(fd, "%argdel") == FAIL)
1201112011
return FAIL;
1201212012
for (i = 0; i < gap->ga_len; ++i)
1201312013
{

src/testdir/test_mksession.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,4 +415,16 @@ func Test_mkview_no_file_name()
415415
%bwipe
416416
endfunc
417417

418+
" A clean session (one empty buffer, one window, and one tab) should not
419+
" set any error messages when sourced because no commands should fail.
420+
func Test_mksession_no_errmsg()
421+
let v:errmsg = ''
422+
%bwipe!
423+
mksession! Xtest_mks.out
424+
source Xtest_mks.out
425+
call assert_equal('', v:errmsg)
426+
call delete('Xtest_mks.out')
427+
endfunc
428+
429+
418430
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,8 @@ static char *(features[]) =
791791

792792
static int included_patches[] =
793793
{ /* Add new patch number below this line */
794+
/**/
795+
789,
794796
/**/
795797
788,
796798
/**/

0 commit comments

Comments
 (0)