1
0
forked from aniani/vim

patch 8.2.5027: error for missing :endif when an exception was thrown

Problem:    Error for missing :endif when an exception was thrown. (Dani
            Dickstein)
Solution:   Do not give an error when aborting. (closes #10490)
This commit is contained in:
Bram Moolenaar
2022-05-27 13:52:08 +01:00
parent 31d9948e3a
commit bf79a4e48d
3 changed files with 21 additions and 1 deletions

View File

@@ -2247,6 +2247,23 @@ func Test_user_command_throw_in_function_call()
unlet g:caught
endfunc
" Test that after reporting an uncaught exception there is no error for a
" missing :endif
func Test_after_exception_no_endif_error()
function Throw()
throw "Failure"
endfunction
function Foo()
if 1
call Throw()
endif
endfunction
call assert_fails('call Foo()', ['E605:', 'E605:'])
delfunc Throw
delfunc Foo
endfunc
" Test for using throw in a called function with following endtry {{{1
func Test_user_command_function_call_with_endtry()
let lines =<< trim END