diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-08-02 15:27:06 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-15 22:57:54 +0100 |
commit | ba34afb37849a8bdf5d601ced7f3c139a80cd396 (patch) | |
tree | 6e6a6d97f78e7b48e02f572bdfa28103cface896 /src | |
parent | 53f28f024c90399106aac5c006e4fd0dd605b564 (diff) | |
download | rneovim-ba34afb37849a8bdf5d601ced7f3c139a80cd396.tar.gz rneovim-ba34afb37849a8bdf5d601ced7f3c139a80cd396.tar.bz2 rneovim-ba34afb37849a8bdf5d601ced7f3c139a80cd396.zip |
vim-patch:8.2.0404: writefile() error does not give a hint
Problem: Writefile() error does not give a hint.
Solution: Add remark about first argument.
https://github.com/vim/vim/commit/18a2b87ca27c378a555b20f14a284d2ce3511427
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/funcs.c | 3 | ||||
-rw-r--r-- | src/nvim/testdir/test_writefile.vim | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 2d58ce1d04..6dd7a92b61 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -11857,7 +11857,8 @@ static void f_writefile(typval_T *argvars, typval_T *rettv, FunPtr fptr) } }); } else if (argvars[0].v_type != VAR_BLOB) { - EMSG2(_(e_invarg2), "writefile()"); + EMSG2(_(e_invarg2), + _("writefile() first argument must be a List or a Blob")); return; } diff --git a/src/nvim/testdir/test_writefile.vim b/src/nvim/testdir/test_writefile.vim index 6922e2185d..2504fcb14e 100644 --- a/src/nvim/testdir/test_writefile.vim +++ b/src/nvim/testdir/test_writefile.vim @@ -17,6 +17,8 @@ func Test_writefile() call assert_equal("morning", l[3]) call assert_equal("vimmers", l[4]) call delete(f) + + call assert_fails('call writefile("text", "Xfile")', 'E475: Invalid argument: writefile() first argument must be a List or a Blob') endfunc func Test_writefile_ignore_regexp_error() |