To: vim_dev@googlegroups.com Subject: Patch 8.2.3017 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///