vim-patch:8.1.1491: fix skipping after exception #10164

Problem:    When skipping over code after an exception was thrown expression
            evaluation is aborted after a function call. (Ingo Karkat)
Solution:   Do not fail if not executing the expression. (closes vim/vim#4507)
6064073841
This commit is contained in:
Daniel Hahler
2019-06-08 19:57:54 +02:00
committed by Justin M. Keyes
parent b398b1eedd
commit 3dd31b2b65
2 changed files with 10 additions and 1 deletions

View File

@@ -4284,7 +4284,7 @@ static int eval7(
// Stop the expression evaluation when immediately // Stop the expression evaluation when immediately
// aborting on error, or when an interrupt occurred or // aborting on error, or when an interrupt occurred or
// an exception was thrown but not caught. // an exception was thrown but not caught.
if (aborting()) { if (evaluate && aborting()) {
if (ret == OK) { if (ret == OK) {
tv_clear(rettv); tv_clear(rettv);
} }

View File

@@ -99,3 +99,12 @@ func Test_let_errmsg()
call assert_fails('let v:errmsg = []', 'E730:') call assert_fails('let v:errmsg = []', 'E730:')
let v:errmsg = '' let v:errmsg = ''
endfunc endfunc
" Test fix for issue #4507
func Test_skip_after_throw()
try
throw 'something'
let x = wincol() || &ts
catch /something/
endtry
endfunc