diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-08-10 19:53:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-08-10 19:53:01 +0200 |
commit | 917c46abe559f3d779ad87500e874376111ca1ef (patch) | |
tree | dfb91ceb975b8a2282937900b74172f4260637ee /src/ex_docmd.c | |
parent | b6f55bb5b4d7d03cdf47d552db20d06e41354d5f (diff) |
patch 8.2.3324: Vim9: Cannot use :silent with :endwhilev8.2.3324
Problem: Vim9: Cannot use :silent with :endwhile.
Solution: Allow for using the :silent modifier. (closes #8737)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 0f0e627d12..9640c500be 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3061,9 +3061,11 @@ parse_command_modifiers( * Return TRUE if "cmod" has anything set. */ int -has_cmdmod(cmdmod_T *cmod) +has_cmdmod(cmdmod_T *cmod, int ignore_silent) { - return cmod->cmod_flags != 0 + return (cmod->cmod_flags != 0 && (!ignore_silent + || (cmod->cmod_flags + & ~(CMOD_SILENT | CMOD_ERRSILENT | CMOD_UNSILENT)) != 0)) || cmod->cmod_split != 0 || cmod->cmod_verbose != 0 || cmod->cmod_tab != 0 @@ -3074,9 +3076,9 @@ has_cmdmod(cmdmod_T *cmod) * If Vim9 script and "cmdmod" has anything set give an error and return TRUE. */ int -cmdmod_error(void) +cmdmod_error(int ignore_silent) { - if (in_vim9script() && has_cmdmod(&cmdmod)) + if (in_vim9script() && has_cmdmod(&cmdmod, ignore_silent)) { emsg(_(e_misplaced_command_modifier)); return TRUE; |