Patch 8.2.3657
Problem:    Vim9: debug text misses one line of return statement.
Solution:   Add a line when not at a debug instruction. (closes #9137)
Files:      src/vim9execute.c, src/testdir/test_debugger.vim


*** ../vim-8.2.3656/src/vim9execute.c   2021-10-17 17:20:20.399745698 +0100
--- src/vim9execute.c   2021-11-23 19:54:50.595715950 +0000
***************
*** 1602,1608 ****
                  || ni->isn_type == ISN_RETURN
                  || ni->isn_type == ISN_RETURN_VOID)
        {
!           end_lnum = ni->isn_lnum;
            break;
        }
  
--- 1602,1608 ----
                  || ni->isn_type == ISN_RETURN
                  || ni->isn_type == ISN_RETURN_VOID)
        {
!           end_lnum = ni->isn_lnum + (ni->isn_type == ISN_DEBUG ? 0 : 1);
            break;
        }
  
*** ../vim-8.2.3656/src/testdir/test_debugger.vim       2021-11-21 
11:35:59.456938797 +0000
--- src/testdir/test_debugger.vim       2021-11-23 19:54:04.655796141 +0000
***************
*** 373,378 ****
--- 373,401 ----
    call delete('Xtest.vim')
  enddef
  
+ def Test_Debugger_break_at_return()
+   var lines =<< trim END
+       vim9script
+       def g:GetNum(): number
+         return 1
+           + 2
+           + 3
+       enddef
+       breakadd func GetNum
+   END
+   writefile(lines, 'Xtest.vim')
+ 
+   # Start Vim in a terminal
+   var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
+   call TermWait(buf)
+ 
+   RunDbgCmd(buf, ':call GetNum()',
+      ['line 1: return 1  + 2  + 3'], {match: 'pattern'})
+ 
+   call StopVimInTerminal(buf)
+   call delete('Xtest.vim')
+ enddef
+ 
  func Test_Backtrace_Through_Source()
    CheckCWD
    let file1 =<< trim END
*** ../vim-8.2.3656/src/version.c       2021-11-23 14:52:03.033446446 +0000
--- src/version.c       2021-11-23 19:47:38.260566400 +0000
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3657,
  /**/

-- 
Kisses may last for as much as, but no more than, five minutes.
                [real standing law in Iowa, United States of America]

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211123221709.9E5AF1C3E18%40moolenaar.net.

Raspunde prin e-mail lui