Fix: Remove balloon '...' in windows != code_window

Problem: In non-code window, user see a '...' balloon even if python
knows it does not need to work
Solution: use pyeval in vim so that python's knowledge is getting back
from the stack as return value
This commit is contained in:
tinmarino 2020-01-09 15:35:38 -03:00
commit 1e153910fa
3 changed files with 22 additions and 11 deletions

View file

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