diff options
author | Mango The Fourth <40720523+MangoIV@users.noreply.github.com> | 2024-05-21 18:23:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-21 18:23:37 +0200 |
commit | d9a2acdab3bfd33584ad468f4d559b0e94f84471 (patch) | |
tree | 7ab11c7028b8cb959c40e25e904b8411a09fa066 /runtime/lua/vim/lsp/codelens.lua | |
parent | ad191be65e2b1641c181506166b1037b548d14a8 (diff) | |
download | rneovim-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
Diffstat (limited to 'runtime/lua/vim/lsp/codelens.lua')
-rw-r--r-- | runtime/lua/vim/lsp/codelens.lua | 2 |
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' }) |