cleaning up

This commit is contained in:
dsych 2021-02-20 00:27:11 -05:00 committed by Ben Jackson
commit 7dcb15f11c
2 changed files with 6 additions and 7 deletions

View file

@ -639,7 +639,7 @@ def DisplayBalloon( is_term, display, is_hover = False ):
# Refer https://github.com/vim/vim/issues/1512#issuecomment-492070685
display = '\n'.join( display )
rc = int( vim.eval(
created_win_id = int( vim.eval(
"vimspector#internal#balloon#CreateTooltip({}, {})".format(
int( is_hover ), json.dumps( display )
)
@ -647,7 +647,7 @@ def DisplayBalloon( is_term, display, is_hover = False ):
vim.eval( "vimspector#internal#balloon#nvim_resize_tooltip()" )
return rc
return created_win_id
def GetBufferFilepath( buf ):

View file

@ -138,7 +138,7 @@ class View:
self.lines = lines
self.draw = draw
self.syntax = None
if ( win is not None ):
if win is not None:
self.buf = win.buffer
utils.SetUpUIWindow( win )
@ -285,7 +285,7 @@ class VariablesView( object ):
},
} )
def _DrawEval( self ):
def _DrawBalloonEval( self ):
watch = self._variable_eval
view = self._variable_eval_view
@ -308,7 +308,6 @@ class VariablesView( object ):
# remove reference to old tooltip window
self._variable_eval_view = None
vim.vars[ 'vimspector_session_windows' ][ 'eval' ] = None
return ''
def VariableEval( self, frame, expression, is_hover ):
"""Callback to display variable under cursor `:h ballonexpr`"""
@ -338,7 +337,7 @@ class VariablesView( object ):
{ 'options': {}, 'buffer': vim.buffers[ float_buf_nr ] }
),
{},
self._DrawEval
self._DrawBalloonEval
)
if watch.result.IsExpandable():
@ -355,7 +354,7 @@ class VariablesView( object ):
},
} )
self._DrawEval()
self._DrawBalloonEval()
def failure_handler( reason, message ):
display = [ reason ]