Patch 8.2.3017
Problem:    Vim9: debugger shows too many lines.
Solution:   Truncate at a comment, "enddef", etc. (closes #8392)
Files:      src/vim9execute.c, src/testdir/test_debugger.vim


*** ../vim-8.2.3016/src/vim9execute.c   2021-06-17 21:03:04.038634999 +0200
--- src/vim9execute.c   2021-06-17 22:22:40.742400846 +0200
***************
*** 1461,1469 ****
      {
        ga_init2(&ga, sizeof(char_u *), 10);
        for (lnum = iptr->isn_lnum; lnum < end_lnum; ++lnum)
            if (ga_grow(&ga, 1) == OK)
!               ((char_u **)(ga.ga_data))[ga.ga_len++] =
!                    skipwhite(((char_u **)ufunc->uf_lines.ga_data)[lnum - 1]);
        line = ga_concat_strings(&ga, "  ");
        vim_free(ga.ga_data);
      }
--- 1461,1477 ----
      {
        ga_init2(&ga, sizeof(char_u *), 10);
        for (lnum = iptr->isn_lnum; lnum < end_lnum; ++lnum)
+       {
+           char_u *p = skipwhite(
+                              ((char_u **)ufunc->uf_lines.ga_data)[lnum - 1]);
+ 
+           if (*p == '#')
+               break;
            if (ga_grow(&ga, 1) == OK)
!               ((char_u **)(ga.ga_data))[ga.ga_len++] = p;
!           if (STRNCMP(p, "def ", 4) == 0)
!               break;
!       }
        line = ga_concat_strings(&ga, "  ");
        vim_free(ga.ga_data);
      }
*** ../vim-8.2.3016/src/testdir/test_debugger.vim       2021-06-16 
22:24:37.282477710 +0200
--- src/testdir/test_debugger.vim       2021-06-17 22:24:30.870163822 +0200
***************
*** 958,963 ****
--- 958,967 ----
           a: 1,
           b: 2,
           }
+          # comment
+          def Inner()
+            eval 1
+          enddef
      enddef
    END
    call writefile(file, 'Xtest.vim')
***************
*** 997,1002 ****
--- 1001,1007 ----
                  \ ':debug call FuncWithDict()',
                  \ ['cmd: call FuncWithDict()'])
    call RunDbgCmd(buf, 'step', ['line 1: var d = {  a: 1,  b: 2,  }'])
+   call RunDbgCmd(buf, 'step', ['line 6: def Inner()'])
  
    call RunDbgCmd(buf, 'cont')
    call StopVimInTerminal(buf)
*** ../vim-8.2.3016/src/version.c       2021-06-17 22:08:13.376738576 +0200
--- src/version.c       2021-06-17 22:21:30.582590012 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     3017,
  /**/

-- 
The goal of science is to build better mousetraps.
The goal of nature is to build better mice.

 /// 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/202106172029.15HKTj2P1742792%40masaka.moolenaar.net.

Raspunde prin e-mail lui