From 7dcb15f11ccb89f3a0a29df8976d2cf9bfe71e0b Mon Sep 17 00:00:00 2001 From: dsych Date: Sat, 20 Feb 2021 00:27:11 -0500 Subject: [PATCH] cleaning up --- python3/vimspector/utils.py | 4 ++-- python3/vimspector/variables.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/python3/vimspector/utils.py b/python3/vimspector/utils.py index d03a344..8010fb9 100644 --- a/python3/vimspector/utils.py +++ b/python3/vimspector/utils.py @@ -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 ): diff --git a/python3/vimspector/variables.py b/python3/vimspector/variables.py index c0cb2fd..7890e1b 100644 --- a/python3/vimspector/variables.py +++ b/python3/vimspector/variables.py @@ -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 ]