Merge pull request #266 from puremourning/dblclick

Add double-click to expand/collapse
This commit is contained in:
mergify[bot] 2020-09-27 12:24:15 +00:00 committed by GitHub
commit d1bfe18e18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 9 deletions

View file

@ -720,7 +720,7 @@ You can configure your choices in the `.vimspector.json`. See
## Variables and scopes
* Current scope shows values of locals.
* Use `<CR>` to expand/collapse (+, -).
* Use `<CR>`, or double-click with left mouse to expand/collapse (+, -).
* When changing the stack frame the locals window updates.
* While paused, hover to see values
@ -737,7 +737,7 @@ to add a new watch expression.
typing the expression. Commit with `<CR>`.
* Alternatively, use `:VimspectorWatch <expression>`. Tab-completion for
expression is available in some debug adapters.
* Expand result with `<CR>`.
* Expand result with `<CR>`, or double-click with left mouse.
* Delete with `<DEL>`.
![watch window](https://puremourning.github.io/vimspector-web/img/vimspector-watch-window.png)
@ -762,8 +762,8 @@ let g:ycm_semantic_triggers = {
## Stack Traces
* In the threads window, use `<CR>` to expand/collapse.
* Use `<CR>` on a stack frame to jump to it.
* In the threads window, use `<CR>`, or double-click with left mouse to expand/collapse.
* Use `<CR>`, or double-click with left mouse on a stack frame to jump to it.
![stack trace](https://puremourning.github.io/vimspector-web/img/vimspector-callstack-window.png)

View file

@ -40,7 +40,10 @@ class StackTraceView( object ):
utils.SetUpHiddenBuffer( self._buf, 'vimspector.StackTrace' )
utils.SetUpUIWindow( win )
vim.command( 'nnoremap <buffer> <CR> :call vimspector#GoToFrame()<CR>' )
vim.command( 'nnoremap <silent> <buffer> <CR> '
':<C-U>call vimspector#GoToFrame()<CR>' )
vim.command( 'nnoremap <silent> <buffer> <2-LeftMouse> '
':<C-U>call vimspector#GoToFrame()<CR>' )
self._line_to_frame = {}
self._line_to_thread = {}

View file

@ -132,13 +132,18 @@ class VariablesView( object ):
self._connection = None
self._current_syntax = ''
def AddExpandMappings():
vim.command( 'nnoremap <silent> <buffer> <CR> '
':<C-u>call vimspector#ExpandVariable()<CR>' )
vim.command( 'nnoremap <silent> <buffer> <2-LeftMouse> '
':<C-u>call vimspector#ExpandVariable()<CR>' )
# Set up the "Variables" buffer in the variables_win
self._scopes: typing.List[ Scope ] = []
self._vars = View( variables_win, {}, self._DrawScopes )
utils.SetUpHiddenBuffer( self._vars.buf, 'vimspector.Variables' )
with utils.LetCurrentWindow( variables_win ):
vim.command(
'nnoremap <buffer> <CR> :call vimspector#ExpandVariable()<CR>' )
AddExpandMappings()
# Set up the "Watches" buffer in the watches_win (and create a WinBar in
# there)
@ -150,8 +155,7 @@ class VariablesView( object ):
'vimspector#AddWatchPrompt',
'vimspector#OmniFuncWatch' )
with utils.LetCurrentWindow( watches_win ):
vim.command(
'nnoremap <buffer> <CR> :call vimspector#ExpandVariable()<CR>' )
AddExpandMappings()
vim.command(
'nnoremap <buffer> <DEL> :call vimspector#DeleteWatch()<CR>' )