Add "run to cursor" support

We add a 'temporary' option to line breakpionts and try and clear any
temporary breakpionts on the line we end up stopping on. This might not
be art, but _probably_ works in almost all cases that matter.

it's a bit hacky the way we have to push the reason around, but we don't
know where we stopped until we actually get the stack trace response and
SetCurrentFrame

Move temporary breakpionts to match server response

Also delete any existing ones when adding a new one and add tests for
run-to-cursor.

Only continue after we successfully set the breakpoints. This makes it
work in go
This commit is contained in:
Ben Jackson 2020-10-13 22:43:52 +01:00
commit 80985148e7
18 changed files with 693 additions and 205 deletions

View file

@ -62,6 +62,9 @@ nnoremap <silent> <Plug>VimspectorStepInto
nnoremap <silent> <Plug>VimspectorStepOut
\ :<c-u>call vimspector#StepOut()<CR>
nnoremap <silent> <Plug>VimspectorRunToCursor
\ :<c-u>call vimspector#RunToCursor()<CR>
if s:mappings ==# 'VISUAL_STUDIO'
nmap <F5> <Plug>VimspectorContinue
nmap <S-F5> <Plug>VimspectorStop
@ -80,6 +83,7 @@ elseif s:mappings ==# 'HUMAN'
nmap <F9> <Plug>VimspectorToggleBreakpoint
nmap <leader><F9> <Plug>VimspectorToggleConditionalBreakpoint
nmap <F8> <Plug>VimspectorAddFunctionBreakpoint
nmap <leader><F8> <Plug>VimspectorRunToCursor
nmap <F10> <Plug>VimspectorStepOver
nmap <F11> <Plug>VimspectorStepInto
nmap <F12> <Plug>VimspectorStepOut
@ -116,9 +120,14 @@ command! -bar -nargs=0
" Dummy autocommands so that we can call this whenever
augroup VimspectorUserAutoCmds
au!
au User VimspectorUICreated silent
au User VimspectorTerminalOpened silent
autocmd!
autocmd User VimspectorUICreated silent
autocmd User VimspectorTerminalOpened silent
augroup END
augroup Vimspector
autocmd!
autocmd BufNew * call vimspector#OnBufferCreated( expand( '<afile>' ) )
augroup END
" boilerplate {{{