Mercurial > vim
comparison src/testdir/test_debugger.vim @ 25719:154663508d9b v8.2.3395
patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Commit: https://github.com/vim/vim/commit/26a4484da20039b61f18d3565a4b4339c4d1f7e3
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 2 18:49:06 2021 +0200
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 #8803)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 02 Sep 2021 19:00:04 +0200 |
parents | bc1633df8a88 |
children | 5e7c96e9036d |
comparison
equal
deleted
inserted
replaced
25718:c3adc383b30f | 25719:154663508d9b |
---|---|
930 call StopVimInTerminal(buf) | 930 call StopVimInTerminal(buf) |
931 call delete('Xtest1.vim') | 931 call delete('Xtest1.vim') |
932 call delete('Xtest2.vim') | 932 call delete('Xtest2.vim') |
933 endfunc | 933 endfunc |
934 | 934 |
935 func Test_DefFunction_expr() | |
936 CheckCWD | |
937 let file3 =<< trim END | |
938 vim9script | |
939 g:someVar = "foo" | |
940 def g:ChangeVar() | |
941 g:someVar = "bar" | |
942 echo "changed" | |
943 enddef | |
944 defcompile | |
945 END | |
946 call writefile(file3, 'Xtest3.vim') | |
947 let buf = RunVimInTerminal('-S Xtest3.vim', {}) | |
948 | |
949 call RunDbgCmd(buf, ':breakadd expr g:someVar') | |
950 call RunDbgCmd(buf, ':call g:ChangeVar()', ['Oldval = "''foo''"', 'Newval = "''bar''"', 'function ChangeVar', 'line 2: echo "changed"']) | |
951 | |
952 call StopVimInTerminal(buf) | |
953 call delete('Xtest3.vim') | |
954 endfunc | |
955 | |
935 func Test_debug_def_and_legacy_function() | 956 func Test_debug_def_and_legacy_function() |
936 CheckCWD | 957 CheckCWD |
937 let file =<< trim END | 958 let file =<< trim END |
938 vim9script | 959 vim9script |
939 def g:SomeFunc() | 960 def g:SomeFunc() |