From ed835c437efba3118f34ea15a16b42a8c034a467 Mon Sep 17 00:00:00 2001 From: Indelog Date: Sun, 21 Nov 2021 11:20:44 +0100 Subject: [PATCH] Fix : no need to check kind for hover reply in preview This is already done in the begin of `processHoverReply`. --- autoload/handlers.vim | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/autoload/handlers.vim b/autoload/handlers.vim index bd4584b..c624d83 100644 --- a/autoload/handlers.vim +++ b/autoload/handlers.vim @@ -335,16 +335,7 @@ def s:processHoverReply(lspserver: dict, req: dict, reply: dict): wincmd P setlocal buftype=nofile setlocal bufhidden=delete - # If lsp server provide kind of hover reply and this kind is in syntaxs - # syported by vim, use it for file type of preview window. Else use - # type text by default. - if reply.result.contents->has_key('kind') -\ && !reply.result.contents.kind->empty() -\ && getcompletion('', 'filetype')->index(reply.result.contents.kind) > -1 - exe 'setlocal ft=' .. reply.result.contents.kind - else - set setlocal ft=text - endif + exe 'setlocal ft=' .. reply.result.contents.kind deletebufline(bufnr(), 1, getbufinfo(bufnr())[0].linecount) append(0, hoverText) cursor(1, 1) -- 2.48.1