]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Not able to use :LspHover with 'keywordprg'
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sat, 17 Jun 2023 17:50:20 +0000 (10:50 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sat, 17 Jun 2023 17:50:20 +0000 (10:50 -0700)
autoload/lsp/hover.vim
doc/lsp.txt
plugin/lsp.vim

index 24ac702612999677acc78d03ea79a0cb76a56e55..d69b7972970a649ef77c72b39b3e22ac87ed6335 100644 (file)
@@ -78,7 +78,7 @@ export def HoverReply(lspserver: dict<any>, hoverResult: any, cmdmods: string):
   # 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 @@ export def HoverReply(lspserver: dict<any>, hoverResult: any, cmdmods: string):
     :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}')
index 14b4cd919e37ae617769c4c9feadeee1d269d821..bd774c4a24328c07120197840b6490eb1263939a 100644 (file)
@@ -770,8 +770,12 @@ can map these commands to keys and make it easier to invoke them.
 
                            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
index 1dbc26dce08cf24821ad3161aec3994b88ec25b7..cc9856ed8f08968fa9d4eac7249616f80d469898 100644 (file)
@@ -75,7 +75,7 @@ command! -nargs=0 -bar -count LspGotoImpl lsp.GotoImplementation(v:false, <q-mod
 command! -nargs=0 -bar -count LspGotoTypeDef lsp.GotoTypedef(v:false, <q-mods>, <count>)
 command! -nargs=0 -bar LspHighlight call LspDocHighlight(<q-mods>)
 command! -nargs=0 -bar LspHighlightClear call LspDocHighlightClear()
-command! -nargs=0 -bar LspHover lsp.Hover(<q-mods>)
+command! -nargs=? -bar LspHover lsp.Hover(<q-mods>)
 command! -nargs=0 -bar LspIncomingCalls lsp.IncomingCalls()
 command! -nargs=0 -bar LspOutgoingCalls lsp.OutgoingCalls()
 command! -nargs=0 -bar -count LspOutline lsp.Outline(<q-mods>, <count>)