0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing

Problem:    Vim9: a failing debug expression aborts script sourcing.
Solution:   Do not let expression failure abort script sourcing. (closes #8848)
This commit is contained in:
Bram Moolenaar
2021-09-08 20:40:34 +02:00
parent 36f691f5f1
commit 072f1c6888
3 changed files with 57 additions and 8 deletions

View File

@@ -318,7 +318,9 @@ func Test_Debugger()
call RunDbgCmd(buf, 'enew! | only!')
call StopVimInTerminal(buf)
endfunc
func Test_Debugger_breakadd()
" Tests for :breakadd file and :breakadd here
" Breakpoints should be set before sourcing the file
@@ -342,10 +344,37 @@ func Test_Debugger()
call delete('Xtest.vim')
%bw!
call assert_fails('breakadd here', 'E32:')
call assert_fails('breakadd file Xtest.vim /\)/', 'E55:')
endfunc
def Test_Debugger_breakadd_expr()
var lines =<< trim END
vim9script
func g:EarlyFunc()
endfunc
breakadd expr DoesNotExist()
func g:LaterFunc()
endfunc
breakdel *
END
writefile(lines, 'Xtest.vim')
# Start Vim in a terminal
var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
call TermWait(buf)
# Despite the failure the functions are defined
RunDbgCmd(buf, ':function g:EarlyFunc',
['function EarlyFunc()', 'endfunction'], {match: 'pattern'})
RunDbgCmd(buf, ':function g:LaterFunc',
['function LaterFunc()', 'endfunction'], {match: 'pattern'})
call StopVimInTerminal(buf)
call delete('Xtest.vim')
enddef
func Test_Backtrace_Through_Source()
CheckCWD
let file1 =<< trim END