Support setting from the balloon
This commit is contained in:
parent
9e1a1ab4b5
commit
c2082cffae
3 changed files with 12 additions and 9 deletions
|
|
@ -124,8 +124,6 @@ function! vimspector#internal#balloon#MouseFilter( winid, key ) abort
|
|||
|
||||
" expand the variable if we got double click
|
||||
if a:key ==? "\<2-leftmouse>"
|
||||
" forward line number to python, since vim does not allow us to focus
|
||||
" the correct window
|
||||
call py3eval( '_vimspector_session.ExpandVariable('
|
||||
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
||||
\ . 'line_num = ' . line( '.', a:winid )
|
||||
|
|
@ -138,13 +136,17 @@ endfunction
|
|||
|
||||
function! vimspector#internal#balloon#CursorFilter( winid, key ) abort
|
||||
if a:key ==? "\<CR>"
|
||||
" forward line number to python, since vim does not allow us to focus
|
||||
" the correct window
|
||||
call py3eval( '_vimspector_session.ExpandVariable('
|
||||
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
||||
\ . 'line_num = ' . line( '.', a:winid )
|
||||
\ . ')' )
|
||||
return 1
|
||||
elseif a:key ==? "\<C-CR>"
|
||||
call py3eval( '_vimspector_session.SetVariableValue('
|
||||
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
||||
\ . 'line_num = ' . line( '.', a:winid )
|
||||
\ . ')' )
|
||||
return 1
|
||||
elseif index( [ "\<LeftMouse>", "\<2-LeftMouse>" ], a:key ) >= 0
|
||||
return vimspector#internal#balloon#MouseFilter( a:winid, a:key )
|
||||
endif
|
||||
|
|
@ -293,6 +295,8 @@ function! s:CreateNeovimTooltip( body ) abort
|
|||
|
||||
nnoremap <silent> <buffer> <CR>
|
||||
\ <cmd>call vimspector#ExpandVariable()<CR>
|
||||
nnoremap <silent> <buffer> <C-CR>
|
||||
\ <cmd>call vimspector#SetVariableValue()<CR>
|
||||
nnoremap <silent> <buffer> <Esc>
|
||||
\ <cmd>quit<CR>
|
||||
nnoremap <silent> <buffer> <2-LeftMouse>
|
||||
|
|
|
|||
|
|
@ -526,9 +526,8 @@ class DebugSession( object ):
|
|||
self._variablesView.ExpandVariable( buf, line_num )
|
||||
|
||||
@IfConnected()
|
||||
def SetVariableValue( self ):
|
||||
# TODO: , buf = None, line_num = None ):
|
||||
self._variablesView.SetVariableValue()
|
||||
def SetVariableValue( self, buf = None, line_num = None ):
|
||||
self._variablesView.SetVariableValue( buf, line_num )
|
||||
|
||||
@IfConnected()
|
||||
def AddWatch( self, expression ):
|
||||
|
|
|
|||
|
|
@ -515,11 +515,11 @@ class VariablesView( object ):
|
|||
},
|
||||
} )
|
||||
|
||||
def SetVariableValue( self ):
|
||||
def SetVariableValue( self, buf = None, line_num = None ):
|
||||
variable: Variable
|
||||
view: View
|
||||
|
||||
variable, view = self._GetVariable( buf = None, line_num = None )
|
||||
variable, view = self._GetVariable( buf, line_num )
|
||||
if variable is None:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue