diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-08-22 18:34:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 18:34:52 -0400 |
commit | 8c49e3d50959e24dadd688f56a18f104bd5fd934 (patch) | |
tree | e75e6d0435ce10e9df427c5b11e943127dad0983 /src/nvim/ex_eval.c | |
parent | 161cdba1e3b8b53f474b2e76655c8c1a5217802f (diff) | |
parent | 246c510b6022b7155c9b78767c41094df7cb2be8 (diff) | |
download | rneovim-8c49e3d50959e24dadd688f56a18f104bd5fd934.tar.gz rneovim-8c49e3d50959e24dadd688f56a18f104bd5fd934.tar.bz2 rneovim-8c49e3d50959e24dadd688f56a18f104bd5fd934.zip |
Merge pull request #12770 from janlazo/vim-8.1.1115
vim-patch:8.1.{1115,2267},8.2.{607,814,1472,1474,1476,1511}
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r-- | src/nvim/ex_eval.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index e99e5b01cd..0c7562980a 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -138,16 +138,15 @@ int aborted_in_try(void) return force_abort; } -/* - * cause_errthrow(): Cause a throw of an error exception if appropriate. - * Return TRUE if the error message should not be displayed by emsg(). - * Sets "ignore", if the emsg() call should be ignored completely. - * - * When several messages appear in the same command, the first is usually the - * most specific one and used as the exception value. The "severe" flag can be - * set to TRUE, if a later but severer message should be used instead. - */ -int cause_errthrow(char_u *mesg, int severe, int *ignore) +// cause_errthrow(): Cause a throw of an error exception if appropriate. +// Return true if the error message should not be displayed by emsg(). +// Sets "ignore", if the emsg() call should be ignored completely. +// +// When several messages appear in the same command, the first is usually the +// most specific one and used as the exception value. The "severe" flag can be +// set to true, if a later but severer message should be used instead. +bool cause_errthrow(const char_u *mesg, bool severe, bool *ignore) + FUNC_ATTR_NONNULL_ALL { struct msglist *elem; struct msglist **plist; @@ -158,8 +157,9 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore) * level. Also when no exception can be thrown. The message will be * displayed by emsg(). */ - if (suppress_errthrow) - return FALSE; + if (suppress_errthrow) { + return false; + } /* * If emsg() has not been called previously, temporarily reset @@ -195,8 +195,8 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore) * not replaced by an interrupt message error exception. */ if (mesg == (char_u *)_(e_interr)) { - *ignore = TRUE; - return TRUE; + *ignore = true; + return true; } /* @@ -231,8 +231,8 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore) * catch clause; just finally clauses are executed before the script * is terminated. */ - return FALSE; - } else + return false; + } else // NOLINT(readability/braces) #endif { /* @@ -271,7 +271,7 @@ int cause_errthrow(char_u *mesg, int severe, int *ignore) (*msg_list)->throw_msg = tmsg; } } - return TRUE; + return true; } } |