]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.0789: sourcing a session sets v:errmsg v8.1.0789
authorBram Moolenaar <Bram@vim.org>
Mon, 21 Jan 2019 22:03:49 +0000 (23:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 21 Jan 2019 22:03:49 +0000 (23:03 +0100)
Problem:    Sourcing a session sets v:errmsg.
Solution:   Use "%argdel" instead of "argdel *". (Jason Franklin)

src/ex_docmd.c
src/testdir/test_mksession.vim
src/version.c

index 4722eddb79f77d458c6d859e774874815e9fe071..387d26d15729c84ca8dba5ee1f50ed9243d68b3a 100644 (file)
@@ -12007,7 +12007,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 (i = 0; i < gap->ga_len; ++i)
     {
index 4d524da0dc26a47a6ae7825849108b2b6e940348..00631f13f8a6e457abe7bcc1fb0262a1720198fd 100644 (file)
@@ -415,4 +415,16 @@ 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
+
+
 " vim: shiftwidth=2 sts=2 expandtab
index fb1e356d9caea2ca35c62d0cb2eb685ce5f56402..364739738b219bf2732eac9d05fe15f608528d69 100644 (file)
@@ -791,6 +791,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    789,
 /**/
     788,
 /**/