Merge pull request #80 from tinmarino/merge_ballon
Fix: Remove balloon '...' in windows != code_window
This commit is contained in:
commit
bda1bb05fd
3 changed files with 22 additions and 11 deletions
|
|
@ -19,13 +19,14 @@ let s:save_cpo = &cpoptions
|
|||
set cpoptions&vim
|
||||
" }}}
|
||||
|
||||
" Returns: py.ShowBalloon( winnr, expresssion )
|
||||
function! vimspector#internal#balloon#BalloonExpr() abort
|
||||
" winnr + 1 because for *no good reason* winnr is 0 based here unlike
|
||||
" everywhere else
|
||||
" int() because for *no good reason* winnr is a string.
|
||||
py3 _vimspector_session.ShowBalloon( int( vim.eval( 'v:beval_winnr' ) ) + 1,
|
||||
\ vim.eval( 'v:beval_text' ) )
|
||||
return '...'
|
||||
return py3eval('_vimspector_session.ShowBalloon('
|
||||
\ . 'int( vim.eval( "v:beval_winnr" ) ) + 1,'
|
||||
\ . 'vim.eval( "v:beval_text" ) )' )
|
||||
endfunction
|
||||
|
||||
" Boilerplate {{{
|
||||
|
|
|
|||
|
|
@ -359,16 +359,22 @@ class DebugSession( object ):
|
|||
self._variablesView.DeleteWatch()
|
||||
|
||||
def ShowBalloon( self, winnr, expression ):
|
||||
if self._stackTraceView.GetCurrentFrame() is None:
|
||||
return
|
||||
"""Proxy: ballonexpr -> variables.ShowBallon"""
|
||||
frame = self._stackTraceView.GetCurrentFrame()
|
||||
# Check if RIP is in a frame
|
||||
if frame is None:
|
||||
self._logger.debug( 'Balloon: Not in a stack frame' )
|
||||
return ''
|
||||
|
||||
if winnr == int( self._codeView._window.number ):
|
||||
self._variablesView.ShowBalloon( self._stackTraceView.GetCurrentFrame(),
|
||||
expression )
|
||||
else:
|
||||
# Check if cursor in code window
|
||||
if winnr != int( self._codeView._window.number ):
|
||||
self._logger.debug( 'Winnr %s is not the code window %s',
|
||||
winnr,
|
||||
self._codeView._window.number )
|
||||
return ''
|
||||
|
||||
# Return variable aware function
|
||||
return self._variablesView.ShowBalloon( frame, expression )
|
||||
|
||||
def ExpandFrameOrThread( self ):
|
||||
self._stackTraceView.ExpandFrameOrThread()
|
||||
|
|
|
|||
|
|
@ -346,8 +346,9 @@ class VariablesView( object ):
|
|||
draw()
|
||||
|
||||
def ShowBalloon( self, frame, expression ):
|
||||
"""Callback to display variable under cursor `:h ballonexpr`"""
|
||||
if not self._connection:
|
||||
return
|
||||
return ''
|
||||
|
||||
def handler( message ):
|
||||
# TODO: this result count be expandable, but we have no way to allow the
|
||||
|
|
@ -366,7 +367,7 @@ class VariablesView( object ):
|
|||
display = [ reason ]
|
||||
utils.DisplayBaloon( self._is_term, display )
|
||||
|
||||
|
||||
# Send async request
|
||||
self._connection.DoRequest( handler, {
|
||||
'command': 'evaluate',
|
||||
'arguments': {
|
||||
|
|
@ -376,6 +377,9 @@ class VariablesView( object ):
|
|||
}
|
||||
}, failure_handler )
|
||||
|
||||
# Return working (meanwhile)
|
||||
return '...'
|
||||
|
||||
|
||||
def SetSyntax( self, syntax ):
|
||||
if not syntax:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue