mirror of
https://github.com/neovim/neovim.git
synced 2026-02-09 05:51:39 +10:00
vim-patch:8.2.3395: Vim9: expression breakpoint not checked in :def function
Problem: Vim9: expression breakpoint not checked in :def function.
Solution: Always compile a function for debugging if there is an expression
breakpoint. (closes vim/vim#8803)
26a4484da2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -971,6 +971,28 @@ func Test_Backtrace_DefFunction()
|
||||
call delete('Xtest2.vim')
|
||||
endfunc
|
||||
|
||||
func Test_DefFunction_expr()
|
||||
CheckRunVimInTerminal
|
||||
CheckCWD
|
||||
let file3 =<< trim END
|
||||
vim9script
|
||||
g:someVar = "foo"
|
||||
def g:ChangeVar()
|
||||
g:someVar = "bar"
|
||||
echo "changed"
|
||||
enddef
|
||||
defcompile
|
||||
END
|
||||
call writefile(file3, 'Xtest3.vim')
|
||||
let buf = RunVimInTerminal('-S Xtest3.vim', {})
|
||||
|
||||
call RunDbgCmd(buf, ':breakadd expr g:someVar')
|
||||
call RunDbgCmd(buf, ':call g:ChangeVar()', ['Oldval = "''foo''"', 'Newval = "''bar''"', 'function ChangeVar', 'line 2: echo "changed"'])
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xtest3.vim')
|
||||
endfunc
|
||||
|
||||
func Test_debug_def_and_legacy_function()
|
||||
CheckRunVimInTerminal
|
||||
CheckCWD
|
||||
|
||||
Reference in New Issue
Block a user