Do not send event after leave buffer.
This commit is contained in:
parent
50dc55e0e8
commit
bcf4120ba4
3 changed files with 5 additions and 11 deletions
|
|
@ -134,6 +134,7 @@ class CodeView( object ):
|
||||||
utils.JumpToWindow( self._window )
|
utils.JumpToWindow( self._window )
|
||||||
try:
|
try:
|
||||||
utils.OpenFileInCurrentWindow( frame[ 'source' ][ 'path' ] )
|
utils.OpenFileInCurrentWindow( frame[ 'source' ][ 'path' ] )
|
||||||
|
vim.command( 'doautocmd <nomodeline> User VimspectorJumpedToFrame' )
|
||||||
except vim.error:
|
except vim.error:
|
||||||
self._logger.exception( 'Unexpected vim error opening file {}'.format(
|
self._logger.exception( 'Unexpected vim error opening file {}'.format(
|
||||||
frame[ 'source' ][ 'path' ] ) )
|
frame[ 'source' ][ 'path' ] ) )
|
||||||
|
|
|
||||||
|
|
@ -76,14 +76,7 @@ def WindowForBuffer( buf ):
|
||||||
def OpenFileInCurrentWindow( file_name ):
|
def OpenFileInCurrentWindow( file_name ):
|
||||||
buffer_number = BufferNumberForFile( file_name )
|
buffer_number = BufferNumberForFile( file_name )
|
||||||
try:
|
try:
|
||||||
if "vimspectorStep" in vim.current.buffer.vars:
|
|
||||||
del vim.current.buffer.vars[ "vimspectorStep" ]
|
|
||||||
# @todo: what if the same buffer is still visited by another thread
|
|
||||||
vim.command( 'doautocmd <nomodeline> User VimspectorFrameLeavePre' )
|
|
||||||
|
|
||||||
vim.current.buffer = vim.buffers[ buffer_number ]
|
vim.current.buffer = vim.buffers[ buffer_number ]
|
||||||
vim.current.buffer.vars[ "vimspectorStep" ] = 1
|
|
||||||
vim.command( 'doautocmd <nomodeline> User VimspectorFrameEnter' )
|
|
||||||
except vim.error as e:
|
except vim.error as e:
|
||||||
if 'E325' not in str( e ):
|
if 'E325' not in str( e ):
|
||||||
raise
|
raise
|
||||||
|
|
|
||||||
|
|
@ -410,16 +410,16 @@ function! Test_CustomWinBar()
|
||||||
%bwipe!
|
%bwipe!
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! Test_VimspectorFrameEnter()
|
function! Test_VimspectorJumpedToFrame()
|
||||||
augroup TestVimspectorFrameEnter
|
augroup TestVimspectorJumpedToFrame
|
||||||
au!
|
au!
|
||||||
au User VimspectorFrameEnter let b:vimspectorStepIsThere = 'foo'
|
au User VimspectorJumpedToFrame let b:vimspectorStepIsThere = 'foo'
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
call s:StartDebugging()
|
call s:StartDebugging()
|
||||||
call assert_equal( 'foo', getbufvar(bufnr(), 'vimspectorStepIsThere', 0) )
|
call assert_equal( 'foo', getbufvar(bufnr(), 'vimspectorStepIsThere', 0) )
|
||||||
|
|
||||||
au! TestVimspectorFrameEnter
|
au! TestVimspectorJumpedToFrame
|
||||||
unlet b:vimspectorStepIsThere
|
unlet b:vimspectorStepIsThere
|
||||||
call vimspector#test#setup#Reset()
|
call vimspector#test#setup#Reset()
|
||||||
%bwipe!
|
%bwipe!
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue