From: Indelog Date: Sun, 21 Nov 2021 10:40:37 +0000 (+0100) Subject: Fix get hover kind from the first test X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=990c01347f0628f491c882c7df6d42d039020217;p=vim-lsp.git Fix get hover kind from the first test --- diff --git a/autoload/handlers.vim b/autoload/handlers.vim index 709f755..23264fe 100644 --- a/autoload/handlers.vim +++ b/autoload/handlers.vim @@ -293,14 +293,17 @@ def s:processHoverReply(lspserver: dict, req: dict, reply: dict): endif var hoverText: list + var hoverKind: string if reply.result.contents->type() == v:t_dict if reply.result.contents->has_key('kind') # MarkupContent if reply.result.contents.kind == 'plaintext' hoverText = reply.result.contents.value->split("\n") + hoverKind = 'text' elseif reply.result.contents.kind == 'markdown' hoverText = reply.result.contents.value->split("\n") + hoverKind = 'markdown' else ErrMsg('Error: Unsupported hover contents type (' .. reply.result.contents.kind .. ')') return @@ -335,7 +338,7 @@ def s:processHoverReply(lspserver: dict, req: dict, reply: dict): wincmd P setlocal buftype=nofile setlocal bufhidden=delete - exe 'setlocal ft=' .. reply.result.contents.kind + exe 'setlocal ft=' .. hoverKind deletebufline(bufnr(), 1, '$') append(0, hoverText) cursor(1, 1)