Use popup_filter_menu for the keyboard-popup rather than 100% our own

This commit is contained in:
Ben Jackson 2021-01-08 22:32:52 +00:00
commit d2ed8a828c

View file

@ -179,7 +179,7 @@ function! vimspector#internal#balloon#CreateTooltip(is_hover, ...)
call win_execute(a:winid, ":call cursor(".mouse_coords['line'].", ".mouse_coords['column'].")") call win_execute(a:winid, ":call cursor(".mouse_coords['line'].", ".mouse_coords['column'].")")
" expand the variable if we got double click " expand the variable if we got double click
if a:key == "\<2-leftmouse>" && mouse_coords['winid'] == a:winid if a:key == "\<2-leftmouse>"
" forward line number to python, since vim does not allow us to focus " forward line number to python, since vim does not allow us to focus
" the correct window " the correct window
call py3eval("_vimspector_session.ExpandVariable(".line('.', a:winid).")") call py3eval("_vimspector_session.ExpandVariable(".line('.', a:winid).")")
@ -191,23 +191,16 @@ function! vimspector#internal#balloon#CreateTooltip(is_hover, ...)
endfunc endfunc
func! CursorFilter(winid, key) func! CursorFilter(winid, key)
if index(['j', 'k'], a:key) >= 0 if a:key == "\<CR>"
call win_execute(a:winid, ':normal '.a:key)
return 1
elseif a:key == "\<cr>"
" forward line number to python, since vim does not allow us to focus " forward line number to python, since vim does not allow us to focus
" the correct window " the correct window
call py3eval("_vimspector_session.ExpandVariable(".line('.', a:winid).")") call py3eval("_vimspector_session.ExpandVariable(".line('.', a:winid).")")
return 1
elseif a:key == "\<esc>"
call vimspector#internal#balloon#closeCallback()
return 1 return 1
elseif index( [ "\<LeftMouse>", "\<2-LeftMouse>" ], a:key ) >= 0
return MouseFilter( a:winid, a:key )
endif endif
return 0 return popup_filter_menu( a:winid, a:key )
endfunc endfunc
if s:float_win != 0 if s:float_win != 0