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 )
|
||||
try:
|
||||
utils.OpenFileInCurrentWindow( frame[ 'source' ][ 'path' ] )
|
||||
vim.command( 'doautocmd <nomodeline> User VimspectorJumpedToFrame' )
|
||||
except vim.error:
|
||||
self._logger.exception( 'Unexpected vim error opening file {}'.format(
|
||||
frame[ 'source' ][ 'path' ] ) )
|
||||
|
|
|
|||
|
|
@ -76,14 +76,7 @@ def WindowForBuffer( buf ):
|
|||
def OpenFileInCurrentWindow( file_name ):
|
||||
buffer_number = BufferNumberForFile( file_name )
|
||||
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.vars[ "vimspectorStep" ] = 1
|
||||
vim.command( 'doautocmd <nomodeline> User VimspectorFrameEnter' )
|
||||
except vim.error as e:
|
||||
if 'E325' not in str( e ):
|
||||
raise
|
||||
|
|
|
|||
|
|
@ -410,16 +410,16 @@ function! Test_CustomWinBar()
|
|||
%bwipe!
|
||||
endfunction
|
||||
|
||||
function! Test_VimspectorFrameEnter()
|
||||
augroup TestVimspectorFrameEnter
|
||||
function! Test_VimspectorJumpedToFrame()
|
||||
augroup TestVimspectorJumpedToFrame
|
||||
au!
|
||||
au User VimspectorFrameEnter let b:vimspectorStepIsThere = 'foo'
|
||||
au User VimspectorJumpedToFrame let b:vimspectorStepIsThere = 'foo'
|
||||
augroup END
|
||||
|
||||
call s:StartDebugging()
|
||||
call assert_equal( 'foo', getbufvar(bufnr(), 'vimspectorStepIsThere', 0) )
|
||||
|
||||
au! TestVimspectorFrameEnter
|
||||
au! TestVimspectorJumpedToFrame
|
||||
unlet b:vimspectorStepIsThere
|
||||
call vimspector#test#setup#Reset()
|
||||
%bwipe!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue