diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-03-14 23:52:17 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-03-15 22:13:32 -0400 |
commit | 2ea6d3ab974aad74cdcbe12a15a7a65956cc6e33 (patch) | |
tree | 370a7cc521db0e6d0a94155dde1ac34c1db51982 /src/nvim/eval.c | |
parent | b90256e6cc2ab22c552660c70462c08ba5fd984b (diff) | |
download | rneovim-2ea6d3ab974aad74cdcbe12a15a7a65956cc6e33.tar.gz rneovim-2ea6d3ab974aad74cdcbe12a15a7a65956cc6e33.tar.bz2 rneovim-2ea6d3ab974aad74cdcbe12a15a7a65956cc6e33.zip |
vim-patch:8.1.0019: error when defining a Lambda with index of a function result
Problem: Error when defining a Lambda with index of a function result.
Solution: When not evaluating an expression and skipping a function call,
set the return value to VAR_UNKNOWN.
https://github.com/vim/vim/commit/b4518563c73460150344a57879bf5b22cb8b1c77
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 8 |
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. */ |