aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMango The Fourth <40720523+MangoIV@users.noreply.github.com>2024-05-21 18:23:37 +0200
committerGitHub <noreply@github.com>2024-05-21 18:23:37 +0200
commitd9a2acdab3bfd33584ad468f4d559b0e94f84471 (patch)
tree7ab11c7028b8cb959c40e25e904b8411a09fa066
parentad191be65e2b1641c181506166b1037b548d14a8 (diff)
downloadrneovim-d9a2acdab3bfd33584ad468f4d559b0e94f84471.tar.gz
rneovim-d9a2acdab3bfd33584ad468f4d559b0e94f84471.tar.bz2
rneovim-d9a2acdab3bfd33584ad468f4d559b0e94f84471.zip
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
-rw-r--r--runtime/lua/vim/lsp/codelens.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua
index a2a0c15b93..c85bb6aa32 100644
--- 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' })