commit d9a2acdab3bfd33584ad468f4d559b0e94f84471
parent ad191be65e2b1641c181506166b1037b548d14a8
Author: Mango The Fourth <40720523+MangoIV@users.noreply.github.com>
Date: Tue, 21 May 2024 18:23:37 +0200
fix(lsp): hide layout in codelenses in virtual text (#28794) (#28807)
Problem: layout i.e. whitespace that is part of codelenses is currently
displayed as weird symbols and large amounts of spaces
Solution: replace all consecutive whitespace symbols with a single space
character when trying to display codelenses as virtual text
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua
@@ -164,7 +164,7 @@ function M.display(lenses, bufnr, client_id)
return a.range.start.character < b.range.start.character
end)
for j, lens in ipairs(line_lenses) do
- local text = lens.command and lens.command.title or 'Unresolved lens ...'
+ local text = (lens.command and lens.command.title or 'Unresolved lens ...'):gsub('%s+', ' ')
table.insert(chunks, { text, 'LspCodeLens' })
if j < num_line_lenses then
table.insert(chunks, { ' | ', 'LspCodeLensSeparator' })