Do not send event after leave buffer.

This commit is contained in:
przepompownia 2021-02-17 01:04:49 +01:00 committed by Ben Jackson
commit bcf4120ba4
3 changed files with 5 additions and 11 deletions

View file

@ -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' ] ) )

View file

@ -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