Mercurial > vim
diff src/vim9compile.c @ 24406:a26f0fa12845 v8.2.2743
patch 8.2.2743: Vim9: function state stuck when compiling with ":silent!"
Commit: https://github.com/vim/vim/commit/599410cb3cb19946cd6df22441da5de003e114bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 10 14:03:43 2021 +0200
patch 8.2.2743: Vim9: function state stuck when compiling with ":silent!"
Problem: Vim9: function state stuck when compiling with ":silent!".
Solution: Check for uf_def_status to be UF_COMPILING.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Apr 2021 14:15:03 +0200 |
parents | a2a7d2d6e724 |
children | 96e0b898d5b4 |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -8429,6 +8429,7 @@ compile_def_function( cctx_T cctx; garray_T *instr; int did_emsg_before = did_emsg; + int did_emsg_silent_before = did_emsg_silent; int ret = FAIL; sctx_T save_current_sctx = current_sctx; int save_estack_compiling = estack_compiling; @@ -8967,6 +8968,9 @@ nextline: generate_instr(&cctx, ISN_RETURN_ZERO); } + // When compiled with ":silent!" and there was an error don't consider the + // function compiled. + if (emsg_silent == 0 || did_emsg_silent == did_emsg_silent_before) { dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) + ufunc->uf_dfunc_idx; @@ -8994,7 +8998,7 @@ nextline: ret = OK; erret: - if (ret == FAIL) + if (ufunc->uf_def_status == UF_COMPILING) { int idx; dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data)