From: D4yvid Date: Wed, 26 Oct 2022 16:51:58 +0000 (-0300) Subject: Fix new lines in completion popup and in the completion detail popup X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ba7de7a82c5fcfdcb763e2df4ed257a4522c51aa;p=vim-lsp.git Fix new lines in completion popup and in the completion detail popup --- diff --git a/autoload/lsp/handlers.vim b/autoload/lsp/handlers.vim index 5ac541f..3215276 100644 --- a/autoload/lsp/handlers.vim +++ b/autoload/lsp/handlers.vim @@ -124,7 +124,12 @@ def ProcessCompletionReply(lspserver: dict, req: dict, reply: dicthas_key('detail') - d.menu = item.detail + # Solve a issue where if a server send a detail field + # with a "\n", on the menu will be everything joined with + # a "^@" separating it. (example: clangd) + var splitted_detail = split(item.detail, "\n") + + d.menu = splitted_detail[0] endif if item->has_key('documentation') if item.documentation->type() == v:t_string && item.documentation != '' @@ -209,7 +214,10 @@ def ProcessResolveReply(lspserver: dict, req: dict, reply: dict): var infoKind: string if reply.result->has_key('detail') - infoText->extend([reply.result.detail]) + # Solve a issue where if a server send the detail field with "\n", + # on the completion popup, everything will be joined with "^@" + # (example: typescript-language-server) + infoText->extend(split(reply.result.detail, "\n")) endif if reply.result->has_key('documentation')