File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ function! lsp#ui#vim#output#closepreview() abort
10
10
" closing floats in vim8.1 must use popup_close() (nvim could use nvim_win_close but pclose
11
11
" works)
12
12
if s: supports_floating && s: winid && g: lsp_preview_float && ! has (' nvim' )
13
- " TODO:
14
13
call popup_close (s: winid )
15
14
else
16
15
pclose
17
16
endif
18
17
let s: winid = v: false
18
+ augroup lsp_float_preview_close
19
+ augroup end
19
20
autocmd ! lsp_float_preview_close CursorMoved ,CursorMovedI ,VimResized *
20
21
doautocmd User lsp_float_closed
21
22
endfunction
@@ -122,7 +123,17 @@ function! s:setcontent(lines, ft) abort
122
123
if s: supports_floating && g: lsp_preview_float && ! has (' nvim' )
123
124
" vim popup
124
125
call setbufline (winbufnr (s: winid ), 1 , a: lines )
126
+ let l: lightline_toggle = v: false
127
+ if exists (' #lightline' ) && ! has (" nvim" )
128
+ " Lightline does not work in popups but does not recognize it yet.
129
+ " It is ugly to have an check for an other plugin here, better fix lightline...
130
+ let l: lightline_toggle = v: true
131
+ call lightline#disable ()
132
+ endif
125
133
call win_execute (s: winid , ' setlocal filetype=' . a: ft . ' .lsp-hover' )
134
+ if l: lightline_toggle
135
+ call lightline#enable ()
136
+ endif
126
137
else
127
138
" nvim floating
128
139
call setline (1 , a: lines )
Original file line number Diff line number Diff line change 1
1
" No usual did_ftplugin header here as we NEED to run this always
2
2
3
- setlocal previewwindow buftype = nofile bufhidden = wipe noswapfile nobuflisted
3
+ if has (' patch-8.1.1517' ) && g: lsp_preview_float && ! has (' nvim' )
4
+ " Can not set buftype or popup_close will fail with 'not a popup window'
5
+ setlocal previewwindow bufhidden = wipe noswapfile nobuflisted
6
+ else
7
+ setlocal previewwindow buftype = nofile bufhidden = wipe noswapfile nobuflisted
8
+ endif
4
9
setlocal nocursorline nofoldenable
5
10
6
11
if has (' syntax' )
You can’t perform that action at this time.
0 commit comments