mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
Fix float position with g:lsp_preview_keep_focus=0 (#419)
This commit is contained in:
committed by
Prabir Shrestha
parent
d848083ca1
commit
ba9e9b5a20
@@ -202,10 +202,8 @@ function! lsp#ui#vim#output#preview(data) abort
|
||||
let l:bufferlines = line('$')
|
||||
let l:maxwidth = max(map(getline(1, '$'), 'strdisplaywidth(v:val)'))
|
||||
|
||||
if g:lsp_preview_keep_focus
|
||||
" restore focus to the previous window
|
||||
call win_gotoid(l:current_window_id)
|
||||
endif
|
||||
" restore focus to the previous window
|
||||
call win_gotoid(l:current_window_id)
|
||||
|
||||
echo ''
|
||||
|
||||
@@ -216,6 +214,11 @@ function! lsp#ui#vim#output#preview(data) abort
|
||||
endif
|
||||
doautocmd User lsp_float_opened
|
||||
endif
|
||||
|
||||
if !g:lsp_preview_keep_focus
|
||||
" set the focus to the preview window
|
||||
call win_gotoid(s:winid)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user