aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 4f8bf63ffe..27d5e4998f 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -197,7 +197,7 @@ static void save_dbg_stuff(struct dbg_stuff *dsp)
static void restore_dbg_stuff(struct dbg_stuff *dsp)
{
- suppress_errthrow = FALSE;
+ suppress_errthrow = false;
trylevel = dsp->trylevel;
force_abort = dsp->force_abort;
caught_stack = dsp->caught_stack;
@@ -394,8 +394,8 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
* Initialize "force_abort" and "suppress_errthrow" at the top level.
*/
if (!recursive) {
- force_abort = FALSE;
- suppress_errthrow = FALSE;
+ force_abort = false;
+ suppress_errthrow = false;
}
// If requested, store and reset the global values controlling the
@@ -879,16 +879,14 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
xfree(sourcing_name);
sourcing_name = saved_sourcing_name;
sourcing_lnum = saved_sourcing_lnum;
+ } else if (got_int || (did_emsg && force_abort)) {
+ // On an interrupt or an aborting error not converted to an exception,
+ // disable the conversion of errors to exceptions. (Interrupts are not
+ // converted any more, here.) This enables also the interrupt message
+ // when force_abort is set and did_emsg unset in case of an interrupt
+ // from a finally clause after an error.
+ suppress_errthrow = true;
}
- /*
- * On an interrupt or an aborting error not converted to an exception,
- * disable the conversion of errors to exceptions. (Interrupts are not
- * converted any more, here.) This enables also the interrupt message
- * when force_abort is set and did_emsg unset in case of an interrupt
- * from a finally clause after an error.
- */
- else if (got_int || (did_emsg && force_abort))
- suppress_errthrow = TRUE;
}
// The current cstack will be freed when do_cmdline() returns. An uncaught
@@ -9293,8 +9291,9 @@ static void ex_match(exarg_T *eap)
static void ex_fold(exarg_T *eap)
{
- if (foldManualAllowed(TRUE))
- foldCreate(eap->line1, eap->line2);
+ if (foldManualAllowed(true)) {
+ foldCreate(curwin, eap->line1, eap->line2);
+ }
}
static void ex_foldopen(exarg_T *eap)