add new preview window id api (#1323)

* add new preview window id api
resolves #1281

* add alias for getpreviewwinid()

* add documentation
This commit is contained in:
fungus
2022-06-18 05:32:24 +00:00
committed by GitHub
parent bf2d083ace
commit 74e458bc9c
3 changed files with 20 additions and 3 deletions

View File

@@ -1216,6 +1216,10 @@ function! lsp#get_progress() abort
return lsp#internal#work_done_progress#get_progress()
endfunction
function! lsp#document_hover_preview_winid() abort
return lsp#internal#document_hover#under_cursor#getpreviewwinid()
endfunction
"
" Scroll vim-lsp related windows.
"

View File

@@ -74,6 +74,13 @@ function! lsp#internal#document_hover#under_cursor#do(options) abort
\ )
endfunction
function! lsp#internal#document_hover#under_cursor#getpreviewwinid() abort
if exists('s:doc_win')
return s:doc_win.get_winid()
endif
return v:null
endfunction
function! s:show_hover(ui, server_name, request, response) abort
if !has_key(a:response, 'result') || empty(a:response['result']) ||
\ empty(a:response['result']['contents'])