autoload/lsp/hover.vim | 7 +++++-- doc/lsp.txt | 6 +++++- plugin/lsp.vim | 2 +- diff --git a/autoload/lsp/hover.vim b/autoload/lsp/hover.vim index 24ac702612999677acc78d03ea79a0cb76a56e55..d69b7972970a649ef77c72b39b3e22ac87ed6335 100644 --- a/autoload/lsp/hover.vim +++ b/autoload/lsp/hover.vim @@ -78,7 +78,7 @@ # Nothing to show if hoverText->empty() if cmdmods !~ 'silent' - util.WarnMsg($'No hover messages found for current position') + util.WarnMsg($'No documentation found for current keyword') endif return endif @@ -95,8 +95,11 @@ exe $'setlocal ft={hoverKind}' :wincmd p else popup_clear() - var winid = hoverText->popup_atcursor({moved: 'word', + var winid = hoverText->popup_atcursor({moved: 'any', + close: 'click', + fixed: true, maxwidth: 80, + minwidth: 80, border: [0, 1, 0, 1], borderchars: [' ']}) win_execute(winid, $'setlocal ft={hoverKind}') diff --git a/doc/lsp.txt b/doc/lsp.txt index 14b4cd919e37ae617769c4c9feadeee1d269d821..bd774c4a24328c07120197840b6490eb1263939a 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -770,8 +770,12 @@ popup set > LspOptionsSet({'hoverInPreview': true}) < - Default is false. + You can use the |K| key in normal mode to display the + documentation for the keyword under the cursor by + setting the 'keywordprg' Vim option: > + :set keywordprg=:LspHover +< *:LspIncomingCalls* :LspIncomingCalls Display a hierarchy of symbols calling the symbol under the cursor in a window. See diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 1dbc26dce08cf24821ad3161aec3994b88ec25b7..cc9856ed8f08968fa9d4eac7249616f80d469898 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -75,7 +75,7 @@ command! -nargs=0 -bar -count LspGotoImpl lsp.GotoImplementation(v:false, , ) command! -nargs=0 -bar -count LspGotoTypeDef lsp.GotoTypedef(v:false, , ) command! -nargs=0 -bar LspHighlight call LspDocHighlight() command! -nargs=0 -bar LspHighlightClear call LspDocHighlightClear() -command! -nargs=0 -bar LspHover lsp.Hover() +command! -nargs=? -bar LspHover lsp.Hover() command! -nargs=0 -bar LspIncomingCalls lsp.IncomingCalls() command! -nargs=0 -bar LspOutgoingCalls lsp.OutgoingCalls() command! -nargs=0 -bar -count LspOutline lsp.Outline(, )