carlitux / deoplete-ternjs

deoplete.nvim source for javascript
MIT License
277 stars 24 forks source link

Function signature disappears #52

Closed gunar closed 7 years ago

gunar commented 7 years ago

deoplete-ternjs mp4

Would there be a way to keep the tooltip visible during arguments filing?

Thanks in advance.

carlitux commented 7 years ago

It is not issue of this source, that is the way that https://github.com/Shougo/deoplete.nvim works. The way I solved is keeping enable the preview and the following config:

let g:deoplete#sources#ternjs#types = 1
let g:deoplete#sources#ternjs#docs = 1

" This to close preview when insert mode leaves
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif

I hope this helps.

gunar commented 7 years ago

Thank you! This is what I ended up using

" Commented out not to disable preview window
" set completeopt-=preview

" Close preview when insert mode leaves
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif

" This was hiding the preview window, so it's commented out
" autocmd CursorMovedI * if pumvisible() == 0|pclose|endif

See: https://github.com/Shougo/deoplete.nvim/issues/115