diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-04-28 20:40:44 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-04-28 20:40:44 +0200 |
commit | 227c58a486d2459e7bf6ed2c917ede7e324e3570 (patch) | |
tree | a434fdecc3b284630170b61d7db110f40772988a /src/ex_docmd.c | |
parent | 03717bf6a27d753fe8f9d713d66594fb1940515f (diff) |
patch 8.2.2817: Vim9: script sourcing continues after an errorv8.2.2817
Problem: Vim9: script sourcing continues after an error.
Solution: Make an error in any command in "vim9script" abort sourcing.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 1c41036a4a..7811c8f7f3 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1175,7 +1175,8 @@ do_cmdline( */ while (!((got_int #ifdef FEAT_EVAL - || (did_emsg && force_abort) || did_throw + || (did_emsg && (force_abort || in_vim9script())) + || did_throw #endif ) #ifdef FEAT_EVAL @@ -1209,8 +1210,10 @@ do_cmdline( /* * If a sourced file or executed function ran to its end, report the * unclosed conditional. + * In Vim9 script do not give a second error, executing aborts after + * the first one. */ - if (!got_int && !did_throw + if (!got_int && !did_throw && !(did_emsg && in_vim9script()) && ((getline_equal(fgetline, cookie, getsourceline) && !source_finished(fgetline, cookie)) || (getline_equal(fgetline, cookie, get_func_line) |