working on variables view

This commit is contained in:
dsych 2020-12-08 21:03:40 -05:00 • committed by Ben Jackson
commit 4c0ba92ac6
2 changed files with 110 additions and 1 deletions

View file

@ -58,10 +58,28 @@ function! vimspector#internal#state#Tooltip() abort
\ . 'vim.eval( "expand(\"<cexpr>\")" ) )' )
endfunction
function! vimspector#internal#state#CreateTooltip() abort
endfunction
function! vimspector#internal#state#TooltipExec(body) abort
let buf = nvim_create_buf(v:false, v:true)
call nvim_buf_set_lines(buf, 0, -1, v:true, a:body)
let opts = { 'relative': 'cursor', 'width': 40, 'height': 2, 'col': 0, 'row': 1, 'anchor': 'NW', 'style': 'minimal' }
" get the max width on a line
let width = 0
let maxWidth = winwidth()
for w in a:body
let width = max(len(w), width)
" reached the max size, no point in looping more
if width > maxWidth
let width = maxWidth
break
endif
endfor
let opts = { 'relative': 'cursor', 'width': width, 'height': len(a:body), 'col': 0, 'row': 1, 'anchor': 'NW', 'style': 'minimal' }
let g:float_win = nvim_open_win(buf, 0, opts)
augroup vimspector#internal#balloon#nvim_float