Skip to content

Commit

Permalink
Don't allow hover window to close preview window (#705)
Browse files Browse the repository at this point in the history
If g:lsp_preview_float is enabled there is no reason to close the
preview window on LspHover and LspSignatureHelp. Moreover the preview
window may be in use by other plugins or by the user.

Co-authored-by: mattn <[email protected]>
  • Loading branch information
clktmr and mattn authored Feb 8, 2020
1 parent 2526438 commit 2a34610
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion autoload/lsp/ui/vim/output.vim
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ function! lsp#ui#vim#output#preview(server, data, options) abort
return call(g:lsp_preview_doubletap[0], [])
endif
" Close any previously opened preview window
pclose
if !g:lsp_preview_float
pclose
endif

let l:current_window_id = win_getid()

Expand Down
2 changes: 1 addition & 1 deletion ftplugin/lsp-hover.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if has('patch-8.1.1517') && g:lsp_preview_float && !has('nvim')
" Can not set buftype or popup_close will fail with 'not a popup window'
setlocal previewwindow bufhidden=wipe noswapfile nobuflisted
setlocal bufhidden=wipe noswapfile nobuflisted
else
setlocal previewwindow buftype=nofile bufhidden=wipe noswapfile nobuflisted
endif
Expand Down

0 comments on commit 2a34610

Please sign in to comment.