mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00
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:
@@ -645,7 +645,7 @@ func s:InstallCommands()
|
|||||||
command Gdb call win_gotoid(s:gdbwin)
|
command Gdb call win_gotoid(s:gdbwin)
|
||||||
command Program call win_gotoid(s:ptywin)
|
command Program call win_gotoid(s:ptywin)
|
||||||
command Source call s:GotoSourcewinOrCreateIt()
|
command Source call s:GotoSourcewinOrCreateIt()
|
||||||
" command Winbar call s:InstallWinbar()
|
command Winbar call s:InstallWinbar()
|
||||||
|
|
||||||
" TODO: can the K mapping be restored?
|
" TODO: can the K mapping be restored?
|
||||||
nnoremap K :Evaluate<CR>
|
nnoremap K :Evaluate<CR>
|
||||||
@@ -655,6 +655,19 @@ endfunc
|
|||||||
|
|
||||||
" let s:winbar_winids = []
|
" 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.
|
" Delete installed debugger commands in the current window.
|
||||||
func s:DeleteCommands()
|
func s:DeleteCommands()
|
||||||
delcommand Break
|
delcommand Break
|
||||||
@@ -670,7 +683,7 @@ func s:DeleteCommands()
|
|||||||
delcommand Gdb
|
delcommand Gdb
|
||||||
delcommand Program
|
delcommand Program
|
||||||
delcommand Source
|
delcommand Source
|
||||||
" delcommand Winbar
|
delcommand Winbar
|
||||||
|
|
||||||
nunmap K
|
nunmap K
|
||||||
|
|
||||||
@@ -940,7 +953,7 @@ func s:GotoSourcewinOrCreateIt()
|
|||||||
func s:GotoSourcewinOrCreateIt()
|
func s:GotoSourcewinOrCreateIt()
|
||||||
if !win_gotoid(s:sourcewin)
|
if !win_gotoid(s:sourcewin)
|
||||||
new
|
new
|
||||||
let s:sourcewin = win_getid(winnr())
|
let s:sourcewin = win_getid(winnr())
|
||||||
call s:InstallWinbar()
|
call s:InstallWinbar()
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
@@ -971,7 +984,7 @@ func s:HandleCursor(msg)
|
|||||||
if &modified
|
if &modified
|
||||||
" TODO: find existing window
|
" TODO: find existing window
|
||||||
exe 'split ' . fnameescape(fname)
|
exe 'split ' . fnameescape(fname)
|
||||||
let s:sourcewin = win_getid(winnr())
|
let s:sourcewin = win_getid(winnr())
|
||||||
call s:InstallWinbar()
|
call s:InstallWinbar()
|
||||||
else
|
else
|
||||||
exe 'edit ' . fnameescape(fname)
|
exe 'edit ' . fnameescape(fname)
|
||||||
|
Reference in New Issue
Block a user