From 2a346106dee7244d470aec1903ef04052bbb8206 Mon Sep 17 00:00:00 2001 From: Timur Celik Date: Sat, 8 Feb 2020 15:16:33 +0100 Subject: [PATCH] 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 --- autoload/lsp/ui/vim/output.vim | 4 +++- ftplugin/lsp-hover.vim | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/lsp/ui/vim/output.vim b/autoload/lsp/ui/vim/output.vim index a06418c85..a99c49547 100644 --- a/autoload/lsp/ui/vim/output.vim +++ b/autoload/lsp/ui/vim/output.vim @@ -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() diff --git a/ftplugin/lsp-hover.vim b/ftplugin/lsp-hover.vim index 26dbe6ba4..4f1a7f46d 100644 --- a/ftplugin/lsp-hover.vim +++ b/ftplugin/lsp-hover.vim @@ -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