diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-10-09 01:25:11 +0100 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-04-13 21:15:24 +0800 |
commit | b6026337f25cc708e932b21a9e4e64a174a1d9da (patch) | |
tree | 12efa60054c7d8e94a7635a22f3a7b264dd6cd71 /src/nvim/testdir/test_trycatch.vim | |
parent | 4dc09f38ee709cadc745ac44a1cc24c4c526ecaf (diff) | |
download | rneovim-b6026337f25cc708e932b21a9e4e64a174a1d9da.tar.gz rneovim-b6026337f25cc708e932b21a9e4e64a174a1d9da.tar.bz2 rneovim-b6026337f25cc708e932b21a9e4e64a174a1d9da.zip |
vim-patch:8.2.3416: second error is reported while exception is being thrown
Problem: Second error is reported while exception is being thrown.
Solution: Do not check for trailing characters when already aborting.
(closes vim/vim#8842)
https://github.com/vim/vim/commit/36f691f5f1d0676f080cc97d697d742ed5cc8251
Diffstat (limited to 'src/nvim/testdir/test_trycatch.vim')
-rw-r--r-- | src/nvim/testdir/test_trycatch.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_trycatch.vim b/src/nvim/testdir/test_trycatch.vim index adc1745b39..04423fa988 100644 --- a/src/nvim/testdir/test_trycatch.vim +++ b/src/nvim/testdir/test_trycatch.vim @@ -1996,5 +1996,29 @@ func Test_reload_in_try_catch() call delete('Xreload') endfunc +" Test for using throw in a called function with following error {{{1 +func Test_user_command_throw_in_function_call() + let lines =<< trim END + function s:get_dict() abort + throw 'my_error' + endfunction + + try + call s:get_dict().foo() + catch /my_error/ + let caught = 'yes' + catch + let caught = 'no' + endtry + call assert_equal('yes', caught) + END + call writefile(lines, 'XtestThrow') + source XtestThrow + + call delete('XtestThrow') + unlet g:caught +endfunc + + " Modeline {{{1 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker |