diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-20 13:06:17 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-07-20 19:06:17 +0200 |
commit | d20bbc802245cc14176028bf209ae3a7e81e21c4 (patch) | |
tree | 5e3e3dc6542e30d2425ae2d600ae4255d643c151 | |
parent | b764120ee727bd387fcb495668e6a620266beb39 (diff) | |
download | rneovim-d20bbc802245cc14176028bf209ae3a7e81e21c4.tar.gz rneovim-d20bbc802245cc14176028bf209ae3a7e81e21c4.tar.bz2 rneovim-d20bbc802245cc14176028bf209ae3a7e81e21c4.zip |
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)
https://github.com/vim/vim/commit/555de4e3b2881b0d9a72242ecc2ba26b5c698c85
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_mksession.vim | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 7a06d19a19..081ca8bf8e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -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) { diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index 7c5b95ae96..d77dac69c7 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -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 |