aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 9c678168bb..515dd0e69f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -21797,15 +21797,15 @@ void ex_return(exarg_T *eap)
} else {
tv_clear(&rettv);
}
- }
- /* It's safer to return also on error. */
- else if (!eap->skip) {
- /*
- * Return unless the expression evaluation has been cancelled due to an
- * aborting error, an interrupt, or an exception.
- */
- if (!aborting())
- returning = do_return(eap, FALSE, TRUE, NULL);
+ } else if (!eap->skip) { // It's safer to return also on error.
+ // In return statement, cause_abort should be force_abort.
+ update_force_abort();
+
+ // Return unless the expression evaluation has been cancelled due to an
+ // aborting error, an interrupt, or an exception.
+ if (!aborting()) {
+ returning = do_return(eap, false, true, NULL);
+ }
}
/* When skipping or the return gets pending, advance to the next command