diff options
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index 9dbdc75c0c..7578378b3b 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -443,15 +443,26 @@ eval_patch( char_u *difffile, char_u *outfile) { - int err; + sctx_T saved_sctx = current_sctx; + sctx_T *ctx; + typval_T *tv; set_vim_var_string(VV_FNAME_IN, origfile, -1); set_vim_var_string(VV_FNAME_DIFF, difffile, -1); set_vim_var_string(VV_FNAME_OUT, outfile, -1); - (void)eval_to_bool(p_pex, &err, NULL, FALSE); + + ctx = get_option_sctx("patchexpr"); + if (ctx != NULL) + current_sctx = *ctx; + + // errors are ignored + tv = eval_expr(p_pex, NULL); + free_tv(tv); + set_vim_var_string(VV_FNAME_IN, NULL, -1); set_vim_var_string(VV_FNAME_DIFF, NULL, -1); set_vim_var_string(VV_FNAME_OUT, NULL, -1); + current_sctx = saved_sctx; } # endif |