Add a reset command to undo all the UI and reset everything

This commit is contained in:
Ben Jackson 2018-05-27 21:34:44 +01:00
commit 7600e1e652
7 changed files with 98 additions and 9 deletions

View file

@ -19,16 +19,18 @@ let s:save_cpo = &cpo
set cpo&vim
" }}}
py3 << EOF
from vimspector import debug_session
_vimspector_session = debug_session.DebugSession()
EOF
call vimspector#internal#state#Reset()
" TODO: Test function
function! vimspector#Launch() abort
py3 _vimspector_session.Start()
endfunction
function! vimspector#Reset() abort
py3 _vimspector_session.Reset()
endfunction
function! vimspector#Restart() abort
py3 _vimspector_session.Restart()
endfunction

View file

@ -103,6 +103,12 @@ function! vimspector#internal#job#StopDebugSession() abort
unlet s:job
endfunction
function! vimspector#internal#job#Reset() abort
if exists( 's:job' )
call vimspector#internal#job#StopDebugSession()
endif
endfunction
" Boilerplate {{{
let &cpo=s:save_cpo
unlet s:save_cpo

View file

@ -0,0 +1,32 @@
" vimspector - A multi-language debugging system for Vim
" Copyright 2018 Ben Jackson
"
" Licensed under the Apache License, Version 2.0 (the "License");
" you may not use this file except in compliance with the License.
" You may obtain a copy of the License at
"
" http://www.apache.org/licenses/LICENSE-2.0
"
" Unless required by applicable law or agreed to in writing, software
" distributed under the License is distributed on an "AS IS" BASIS,
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
" See the License for the specific language governing permissions and
" limitations under the License.
" Boilerplate {{{
let s:save_cpo = &cpo
set cpo&vim
" }}}
function! vimspector#internal#state#Reset()
py3 << EOF
from vimspector import debug_session
_vimspector_session = debug_session.DebugSession()
EOF
endfunction
" Boilerplate {{{
let &cpo=s:save_cpo
unlet s:save_cpo
" }}}