0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2817: Vim9: script sourcing continues after an error

Problem:    Vim9: script sourcing continues after an error.
Solution:   Make an error in any command in "vim9script" abort sourcing.
This commit is contained in:
Bram Moolenaar
2021-04-28 20:40:44 +02:00
parent 03717bf6a2
commit 227c58a486
5 changed files with 28 additions and 7 deletions

View File

@@ -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)