changeset 15563:e6d2e41669b8 v8.1.0789

patch 8.1.0789: sourcing a session sets v:errmsg commit https://github.com/vim/vim/commit/555de4e3b2881b0d9a72242ecc2ba26b5c698c85 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 21 23:03:49 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Jan 2019 23:15:06 +0100
parents 944d93a51267
children acb0995b8a2c
files src/ex_docmd.c src/testdir/test_mksession.vim src/version.c
diffstat 3 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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)
     {
--- a/src/testdir/test_mksession.vim
+++ b/src/testdir/test_mksession.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -792,6 +792,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    789,
+/**/
     788,
 /**/
     787,