Don't allow hover window to close preview window (#705)

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 <mattn.jp@gmail.com>
This commit is contained in:
Timur Celik
2020-02-08 15:16:33 +01:00
committed by GitHub
parent 2526438c44
commit 2a346106de
2 changed files with 4 additions and 2 deletions

View File

@@ -297,7 +297,9 @@ function! lsp#ui#vim#output#preview(server, data, options) abort
return call(g:lsp_preview_doubletap[0], []) return call(g:lsp_preview_doubletap[0], [])
endif endif
" Close any previously opened preview window " Close any previously opened preview window
if !g:lsp_preview_float
pclose pclose
endif
let l:current_window_id = win_getid() let l:current_window_id = win_getid()

View File

@@ -2,7 +2,7 @@
if has('patch-8.1.1517') && g:lsp_preview_float && !has('nvim') 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' " 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 else
setlocal previewwindow buftype=nofile bufhidden=wipe noswapfile nobuflisted setlocal previewwindow buftype=nofile bufhidden=wipe noswapfile nobuflisted
endif endif