We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d848083 commit ba9e9b5Copy full SHA for ba9e9b5
autoload/lsp/ui/vim/output.vim
@@ -202,10 +202,8 @@ function! lsp#ui#vim#output#preview(data) abort
202
let l:bufferlines = line('$')
203
let l:maxwidth = max(map(getline(1, '$'), 'strdisplaywidth(v:val)'))
204
205
- if g:lsp_preview_keep_focus
206
- " restore focus to the previous window
207
- call win_gotoid(l:current_window_id)
208
- endif
+ " restore focus to the previous window
+ call win_gotoid(l:current_window_id)
209
210
echo ''
211
@@ -216,6 +214,11 @@ function! lsp#ui#vim#output#preview(data) abort
216
214
endif
217
215
doautocmd User lsp_float_opened
218
+
+ if !g:lsp_preview_keep_focus
219
+ " set the focus to the preview window
220
+ call win_gotoid(s:winid)
221
+ endif
222
return ''
223
endfunction
224
0 commit comments