1
0
forked from aniani/vim

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

@@ -2592,6 +2592,7 @@ enddef
def Test_nested_lambda_in_closure()
var lines =<< trim END
vim9script
command WriteDone writefile(['Done'], 'XnestedDone')
def Outer()
def g:Inner()
echo map([1, 2, 3], {_, v -> v + 1})
@@ -2599,10 +2600,9 @@ def Test_nested_lambda_in_closure()
g:Inner()
enddef
defcompile
writefile(['Done'], 'XnestedDone')
quit
# not reached
END
if !RunVim([], lines, '--clean')
if !RunVim([], lines, '--clean -c WriteDone -c quit')
return
endif
assert_equal(['Done'], readfile('XnestedDone'))