aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 5ef2a8772e..df677a3a13 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -6328,8 +6328,12 @@ call_func(
}
- /* execute the function if no errors detected and executing */
- if (evaluate && error == ERROR_NONE) {
+ // Execute the function if executing and no errors were detected.
+ if (!evaluate) {
+ // Not evaluating, which means the return value is unknown. This
+ // matters for giving error messages.
+ rettv->v_type = VAR_UNKNOWN;
+ } else if (error == ERROR_NONE) {
char_u *rfname = fname;
/* Ignore "g:" before a function name. */