diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-10 13:52:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-10 13:52:26 +0100 |
commit | 55e9366e32bc0e1056478d1d0ae935f9cf039d6a (patch) | |
tree | f29bfdfceb04f972b6834f8a7a3d1c59668ee903 /src/eval.c | |
parent | 71b6d3397649fed68ef587aa863fcbdf5fdb057a (diff) |
patch 9.0.0437: no error when custom completion function returns wrong typev9.0.0437
Problem: No error when a custom completion function returns something else
than the expected list.
Solution: Give an error. (closes #11100)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index db8b4e6c98..f208ab1009 100644 --- a/src/eval.c +++ b/src/eval.c @@ -842,6 +842,7 @@ call_func_retstr( * Call Vim script function "func" and return the result as a List. * Uses "argv" and "argc" as call_func_retstr(). * Returns NULL when there is something wrong. + * Gives an error when the returned value is not a list. */ void * call_func_retlist( @@ -856,6 +857,8 @@ call_func_retlist( if (rettv.v_type != VAR_LIST) { + semsg(_(e_custom_list_completion_function_does_not_return_list_but_str), + vartype_name(rettv.v_type)); clear_tv(&rettv); return NULL; } |