To: vim_dev@googlegroups.com Subject: Patch 8.0.1107 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1107 Problem: Terminal debugger jumps to non-existing file. Solution: Check that the file exists. Add an option to make the Vim wide wide. Fix removing highlight groups. Files: runtime/pack/dist/opt/termdebug/plugin/termdebug.vim, runtime/doc/terminal.txt *** ../vim-8.0.1106/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim 2017-09-10 19:13:55.902536551 +0200 --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim 2017-09-14 16:02:15.409023560 +0200 *************** *** 24,39 **** let termdebugger = 'gdb' endif - " Sign used to highlight the line where the program has stopped. - " There can be only one. - sign define debugPC linehl=debugPC let s:pc_id = 12 let s:break_id = 13 - " Sign used to indicate a breakpoint. - " Can be used multiple times. - sign define debugBreakpoint text=>> texthl=debugBreakpoint - if &background == 'light' hi default debugPC term=reverse ctermbg=lightblue guibg=lightblue else --- 24,32 ---- *************** *** 45,53 **** --- 38,56 ---- let s:startwin = win_getid(winnr()) let s:startsigncolumn = &signcolumn + if exists('g:termdebug_wide') && &columns < g:termdebug_wide + let s:save_columns = &columns + let &columns = g:termdebug_wide + let vertical = 1 + else + let s:save_columns = 0 + let vertical = 0 + endif + " Open a terminal window without a job, to run the debugged program let s:ptybuf = term_start('NONE', { \ 'term_name': 'gdb program', + \ 'vertical': vertical, \ }) if s:ptybuf == 0 echoerr 'Failed to open the program terminal window' *************** *** 87,92 **** --- 90,103 ---- " Connect gdb to the communication pty, using the GDB/MI interface call term_sendkeys(gdbbuf, 'new-ui mi ' . commpty . "\r") + " Sign used to highlight the line where the program has stopped. + " There can be only one. + sign define debugPC linehl=debugPC + + " Sign used to indicate a breakpoint. + " Can be used multiple times. + sign define debugBreakpoint text=>> texthl=debugBreakpoint + " Install debugger commands in the text window. call win_gotoid(s:startwin) call s:InstallCommands() *************** *** 106,111 **** --- 117,125 ---- call s:DeleteCommands() call win_gotoid(curwinid) + if s:save_columns > 0 + let &columns = s:save_columns + endif endfunc " Handle a message received from gdb on the GDB/MI interface. *************** *** 162,173 **** delcommand Program nunmap K - sign undefine debugPC - sign undefine debugBreakpoint exe 'sign unplace ' . s:pc_id for key in keys(s:breakpoints) exe 'sign unplace ' . (s:break_id + key) endfor unlet s:breakpoints endfunc --- 176,187 ---- delcommand Program nunmap K exe 'sign unplace ' . s:pc_id for key in keys(s:breakpoints) exe 'sign unplace ' . (s:break_id + key) endfor + sign undefine debugPC + sign undefine debugBreakpoint unlet s:breakpoints endfunc *************** *** 232,239 **** let wid = win_getid(winnr()) if win_gotoid(s:startwin) ! if a:msg =~ '^\*stopped' ! let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '') let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '') if lnum =~ '^[0-9]*$' if expand('%:h') != fname --- 246,253 ---- let wid = win_getid(winnr()) if win_gotoid(s:startwin) ! let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '') ! if a:msg =~ '^\*stopped' && filereadable(fname) let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '') if lnum =~ '^[0-9]*$' if expand('%:h') != fname *** ../vim-8.0.1106/runtime/doc/terminal.txt 2017-09-10 19:13:55.902536551 +0200 --- runtime/doc/terminal.txt 2017-09-13 23:59:02.663265484 +0200 *************** *** 1,4 **** ! *terminal.txt* For Vim version 8.0. Last change: 2017 Sep 10 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *terminal.txt* For Vim version 8.0. Last change: 2017 Sep 13 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 85,93 **** See option 'termsize' for controlling the size of the terminal window. (TODO: scrolling when the terminal is larger than the window) ! The terminal uses the 'background' option to decide whether the terminal ! window will start with a white or black background. The job running in the ! terminal can change the colors. Syntax ~ --- 85,98 ---- See option 'termsize' for controlling the size of the terminal window. (TODO: scrolling when the terminal is larger than the window) ! The job running in the terminal can change the colors. The default foreground ! and background colors are taken from Vim, the Normal highlight group. ! ! For a color terminal the 'background' option is used to decide whether the ! terminal window will start with a white or black background. ! ! To use a different color the Terminal highlight group can be used: > ! hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue Syntax ~ *************** *** 403,408 **** --- 408,419 ---- hi debugPC term=reverse ctermbg=darkblue guibg=darkblue hi debugBreakpoint term=reverse ctermbg=red guibg=red + To change the width of the Vim window when debugging starts, and use a + vertical split: > + let g:termdebug_wide = 163 + This will set &columns to 163 when :Termdebug is used. The value is restored + when quitting the debugger. + vim:tw=78:ts=8:ft=help:norl: *** ../vim-8.0.1106/src/version.c 2017-09-14 15:55:09.039518495 +0200 --- src/version.c 2017-09-14 16:05:30.311864375 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1107, /**/ -- ~ ~ ~ ".signature" 4 lines, 50 characters written /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///