Mercurial > vim
comparison src/testdir/test_terminal3.vim @ 26608:1eb62546e20c v8.2.3833
patch 8.2.3833: error from term_start() not caught by try/catch
Commit: https://github.com/vim/vim/commit/c3f91c0648f4b04a6a9ceb4ccec45ea767a63796
Author: ichizok <gclient.gaap@gmail.com>
Date: Fri Dec 17 09:44:33 2021 +0000
patch 8.2.3833: error from term_start() not caught by try/catch
Problem: Error from term_start() not caught by try/catch.
Solution: save and restore did_emsg when applying autocommands. (Ozaki
Kiichi, closes #9361)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 17 Dec 2021 10:45:07 +0100 |
parents | c83460a14407 |
children | 8bb07c88ac27 |
comparison
equal
deleted
inserted
replaced
26607:6569c68ede92 | 26608:1eb62546e20c |
---|---|
899 call StopVimInTerminal(buf) | 899 call StopVimInTerminal(buf) |
900 set splitright& | 900 set splitright& |
901 only! | 901 only! |
902 endfunc | 902 endfunc |
903 | 903 |
904 func Test_terminal_term_start_error() | |
905 func s:term_start_error() abort | |
906 try | |
907 return term_start([[]]) | |
908 catch | |
909 return v:exception | |
910 finally | |
911 " | |
912 endtry | |
913 endfunc | |
914 autocmd WinEnter * call type(0) | |
915 | |
916 " Must not crash in s:term_start_error, nor the exception thrown. | |
917 let result = s:term_start_error() | |
918 call assert_match('^Vim(return):E730:', result) | |
919 | |
920 autocmd! WinEnter | |
921 delfunc s:term_start_error | |
922 endfunc | |
923 | |
904 | 924 |
905 " vim: shiftwidth=2 sts=2 expandtab | 925 " vim: shiftwidth=2 sts=2 expandtab |