From 910967e5afff3cb2b9719d2eef0e37ba25040992 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 5 Jul 2021 00:39:46 +0200 Subject: fix(lsp): prevent double for cached plaintext markup --- runtime/lua/vim/lsp/util.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/lsp/util.lua') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 195e3a0e65..06afc2c5e2 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -810,16 +810,16 @@ function M.convert_input_to_markdown_lines(input, contents) -- If it's plaintext, then wrap it in a block -- Some servers send input.value as empty, so let's ignore this :( - input.value = input.value or '' + local value = input.value or '' if input.kind == "plaintext" then -- wrap this in a block so that stylize_markdown -- can properly process it as plaintext - input.value = string.format("\n%s\n", input.value or "") + value = string.format("\n%s\n", value) end - -- assert(type(input.value) == 'string') - list_extend(contents, split_lines(input.value)) + -- assert(type(value) == 'string') + list_extend(contents, split_lines(value)) -- MarkupString variation 2 elseif input.language then -- Some servers send input.value as empty, so let's ignore this :( -- cgit