Mercurial > vim
diff src/ex_docmd.c @ 25575:9f691e8a74e3 v8.2.3324
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Commit: https://github.com/vim/vim/commit/917c46abe559f3d779ad87500e874376111ca1ef
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 10 19:53:01 2021 +0200
patch 8.2.3324: Vim9: Cannot use :silent with :endwhile
Problem: Vim9: Cannot use :silent with :endwhile.
Solution: Allow for using the :silent modifier. (closes https://github.com/vim/vim/issues/8737)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 10 Aug 2021 20:00:05 +0200 |
parents | 0082503ff2ff |
children | 15b54e0a576b |
line wrap: on
line diff
--- 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) -{ - return cmod->cmod_flags != 0 +has_cmdmod(cmdmod_T *cmod, int ignore_silent) +{ + 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) -{ - if (in_vim9script() && has_cmdmod(&cmdmod)) +cmdmod_error(int ignore_silent) +{ + if (in_vim9script() && has_cmdmod(&cmdmod, ignore_silent)) { emsg(_(e_misplaced_command_modifier)); return TRUE;