Mercurial > vim
comparison src/ex_eval.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 | e0d6268c153a |
children | 8556ded8a462 |
comparison
equal
deleted
inserted
replaced
25574:bd32fe0605af | 25575:9f691e8a74e3 |
---|---|
1024 void | 1024 void |
1025 ex_endif(exarg_T *eap) | 1025 ex_endif(exarg_T *eap) |
1026 { | 1026 { |
1027 cstack_T *cstack = eap->cstack; | 1027 cstack_T *cstack = eap->cstack; |
1028 | 1028 |
1029 if (cmdmod_error()) | 1029 if (cmdmod_error(FALSE)) |
1030 return; | 1030 return; |
1031 did_endif = TRUE; | 1031 did_endif = TRUE; |
1032 if (cstack->cs_idx < 0 | 1032 if (cstack->cs_idx < 0 |
1033 || (cstack->cs_flags[cstack->cs_idx] | 1033 || (cstack->cs_flags[cstack->cs_idx] |
1034 & (CSF_WHILE | CSF_FOR | CSF_TRY | CSF_BLOCK))) | 1034 & (CSF_WHILE | CSF_FOR | CSF_TRY | CSF_BLOCK))) |
1353 int idx; | 1353 int idx; |
1354 char *err; | 1354 char *err; |
1355 int csf; | 1355 int csf; |
1356 int fl; | 1356 int fl; |
1357 | 1357 |
1358 if (cmdmod_error()) | 1358 if (cmdmod_error(TRUE)) |
1359 return; | 1359 return; |
1360 | 1360 |
1361 if (eap->cmdidx == CMD_endwhile) | 1361 if (eap->cmdidx == CMD_endwhile) |
1362 { | 1362 { |
1363 err = e_while; | 1363 err = e_while; |
1591 ex_try(exarg_T *eap) | 1591 ex_try(exarg_T *eap) |
1592 { | 1592 { |
1593 int skip; | 1593 int skip; |
1594 cstack_T *cstack = eap->cstack; | 1594 cstack_T *cstack = eap->cstack; |
1595 | 1595 |
1596 if (cmdmod_error()) | 1596 if (cmdmod_error(FALSE)) |
1597 return; | 1597 return; |
1598 | 1598 |
1599 if (cstack->cs_idx == CSTACK_LEN - 1) | 1599 if (cstack->cs_idx == CSTACK_LEN - 1) |
1600 eap->errmsg = _("E601: :try nesting too deep"); | 1600 eap->errmsg = _("E601: :try nesting too deep"); |
1601 else | 1601 else |
1672 regmatch_T regmatch; | 1672 regmatch_T regmatch; |
1673 int prev_got_int; | 1673 int prev_got_int; |
1674 cstack_T *cstack = eap->cstack; | 1674 cstack_T *cstack = eap->cstack; |
1675 char_u *pat; | 1675 char_u *pat; |
1676 | 1676 |
1677 if (cmdmod_error()) | 1677 if (cmdmod_error(FALSE)) |
1678 return; | 1678 return; |
1679 | 1679 |
1680 if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) | 1680 if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) |
1681 { | 1681 { |
1682 eap->errmsg = _(e_catch); | 1682 eap->errmsg = _(e_catch); |
1837 int idx; | 1837 int idx; |
1838 int skip = FALSE; | 1838 int skip = FALSE; |
1839 int pending = CSTP_NONE; | 1839 int pending = CSTP_NONE; |
1840 cstack_T *cstack = eap->cstack; | 1840 cstack_T *cstack = eap->cstack; |
1841 | 1841 |
1842 if (cmdmod_error()) | 1842 if (cmdmod_error(FALSE)) |
1843 return; | 1843 return; |
1844 | 1844 |
1845 if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) | 1845 if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) |
1846 eap->errmsg = _(e_finally); | 1846 eap->errmsg = _(e_finally); |
1847 else | 1847 else |
1969 int rethrow = FALSE; | 1969 int rethrow = FALSE; |
1970 int pending = CSTP_NONE; | 1970 int pending = CSTP_NONE; |
1971 void *rettv = NULL; | 1971 void *rettv = NULL; |
1972 cstack_T *cstack = eap->cstack; | 1972 cstack_T *cstack = eap->cstack; |
1973 | 1973 |
1974 if (cmdmod_error()) | 1974 if (cmdmod_error(FALSE)) |
1975 return; | 1975 return; |
1976 | 1976 |
1977 if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) | 1977 if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0) |
1978 eap->errmsg = _(e_no_endtry); | 1978 eap->errmsg = _(e_no_endtry); |
1979 else | 1979 else |