vim-patch:8.0.1668: terminal debugger: can't re-open source code window (#12329)

Problem:    Terminal debugger: can't re-open source code window.
Solution:   Add the :Source command.  Also create the window if needed when
            gdb stops at a source line.
c4b533e1e9
This commit is contained in:
Jan Edmund Lazo 2020-05-24 14:46:41 -04:00 committed by GitHub
parent e89462d985
commit 37ee95504e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -645,7 +645,7 @@ func s:InstallCommands()
command Gdb call win_gotoid(s:gdbwin)
command Program call win_gotoid(s:ptywin)
command Source call s:GotoSourcewinOrCreateIt()
" command Winbar call s:InstallWinbar()
command Winbar call s:InstallWinbar()
" TODO: can the K mapping be restored?
nnoremap K :Evaluate<CR>
@ -655,6 +655,19 @@ endfunc
" let s:winbar_winids = []
" Install the window toolbar in the current window.
func s:InstallWinbar()
" if has('menu') && &mouse != ''
" nnoremenu WinBar.Step :Step<CR>
" nnoremenu WinBar.Next :Over<CR>
" nnoremenu WinBar.Finish :Finish<CR>
" nnoremenu WinBar.Cont :Continue<CR>
" nnoremenu WinBar.Stop :Stop<CR>
" nnoremenu WinBar.Eval :Evaluate<CR>
" call add(s:winbar_winids, win_getid(winnr()))
" endif
endfunc
" Delete installed debugger commands in the current window.
func s:DeleteCommands()
delcommand Break
@ -670,7 +683,7 @@ func s:DeleteCommands()
delcommand Gdb
delcommand Program
delcommand Source
" delcommand Winbar
delcommand Winbar
nunmap K
@ -940,7 +953,7 @@ func s:GotoSourcewinOrCreateIt()
if !win_gotoid(s:sourcewin)
new
let s:sourcewin = win_getid(winnr())
" call s:InstallWinbar()
call s:InstallWinbar()
endif
endfunc
@ -971,7 +984,7 @@ func s:HandleCursor(msg)
" TODO: find existing window
exe 'split ' . fnameescape(fname)
let s:sourcewin = win_getid(winnr())
" call s:InstallWinbar()
call s:InstallWinbar()
else
exe 'edit ' . fnameescape(fname)
endif