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
|
" expand the variable if we got double click
|
||||||
if a:key ==? "\<2-leftmouse>"
|
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('
|
call py3eval( '_vimspector_session.ExpandVariable('
|
||||||
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
||||||
\ . 'line_num = ' . line( '.', a:winid )
|
\ . 'line_num = ' . line( '.', a:winid )
|
||||||
|
|
@ -138,13 +136,17 @@ endfunction
|
||||||
|
|
||||||
function! vimspector#internal#balloon#CursorFilter( winid, key ) abort
|
function! vimspector#internal#balloon#CursorFilter( winid, key ) abort
|
||||||
if a:key ==? "\<CR>"
|
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('
|
call py3eval( '_vimspector_session.ExpandVariable('
|
||||||
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
\ . 'buf = vim.buffers[ ' . winbufnr( a:winid ) . ' ],'
|
||||||
\ . 'line_num = ' . line( '.', a:winid )
|
\ . 'line_num = ' . line( '.', a:winid )
|
||||||
\ . ')' )
|
\ . ')' )
|
||||||
return 1
|
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
|
elseif index( [ "\<LeftMouse>", "\<2-LeftMouse>" ], a:key ) >= 0
|
||||||
return vimspector#internal#balloon#MouseFilter( a:winid, a:key )
|
return vimspector#internal#balloon#MouseFilter( a:winid, a:key )
|
||||||
endif
|
endif
|
||||||
|
|
@ -293,6 +295,8 @@ function! s:CreateNeovimTooltip( body ) abort
|
||||||
|
|
||||||
nnoremap <silent> <buffer> <CR>
|
nnoremap <silent> <buffer> <CR>
|
||||||
\ <cmd>call vimspector#ExpandVariable()<CR>
|
\ <cmd>call vimspector#ExpandVariable()<CR>
|
||||||
|
nnoremap <silent> <buffer> <C-CR>
|
||||||
|
\ <cmd>call vimspector#SetVariableValue()<CR>
|
||||||
nnoremap <silent> <buffer> <Esc>
|
nnoremap <silent> <buffer> <Esc>
|
||||||
\ <cmd>quit<CR>
|
\ <cmd>quit<CR>
|
||||||
nnoremap <silent> <buffer> <2-LeftMouse>
|
nnoremap <silent> <buffer> <2-LeftMouse>
|
||||||
|
|
|
||||||
|
|
@ -526,9 +526,8 @@ class DebugSession( object ):
|
||||||
self._variablesView.ExpandVariable( buf, line_num )
|
self._variablesView.ExpandVariable( buf, line_num )
|
||||||
|
|
||||||
@IfConnected()
|
@IfConnected()
|
||||||
def SetVariableValue( self ):
|
def SetVariableValue( self, buf = None, line_num = None ):
|
||||||
# TODO: , buf = None, line_num = None ):
|
self._variablesView.SetVariableValue( buf, line_num )
|
||||||
self._variablesView.SetVariableValue()
|
|
||||||
|
|
||||||
@IfConnected()
|
@IfConnected()
|
||||||
def AddWatch( self, expression ):
|
def AddWatch( self, expression ):
|
||||||
|
|
|
||||||
|
|
@ -515,11 +515,11 @@ class VariablesView( object ):
|
||||||
},
|
},
|
||||||
} )
|
} )
|
||||||
|
|
||||||
def SetVariableValue( self ):
|
def SetVariableValue( self, buf = None, line_num = None ):
|
||||||
variable: Variable
|
variable: Variable
|
||||||
view: View
|
view: View
|
||||||
|
|
||||||
variable, view = self._GetVariable( buf = None, line_num = None )
|
variable, view = self._GetVariable( buf, line_num )
|
||||||
if variable is None:
|
if variable is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue