aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/eval.c3
-rw-r--r--test/old/testdir/test_expr.vim5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index bbe4fe055d..b240c36977 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -3149,8 +3149,9 @@ static int eval7(char **arg, typval_T *rettv, evalarg_T *const evalarg, bool wan
ret = FAIL;
} else {
const int flags = evalarg == NULL ? 0 : evalarg->eval_flags;
- if (**arg == '(') {
+ if (*skipwhite(*arg) == '(') {
// "name(..." recursive!
+ *arg = skipwhite(*arg);
ret = eval_func(arg, evalarg, s, len, rettv, flags, NULL);
} else if (evaluate) {
// get value of variable
diff --git a/test/old/testdir/test_expr.vim b/test/old/testdir/test_expr.vim
index 1a00a85b0f..a860cf2970 100644
--- a/test/old/testdir/test_expr.vim
+++ b/test/old/testdir/test_expr.vim
@@ -717,6 +717,11 @@ func Test_expr_eval_error()
call assert_fails("let v = -{}", 'E728:')
endfunc
+func Test_white_in_function_call()
+ let text = substitute ( 'some text' , 't' , 'T' , 'g' )
+ call assert_equal('some TexT', text)
+endfunc
+
" Test for float value comparison
func Test_float_compare()
CheckFeature float