mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 11:26:37 +00:00
fix(lsp): handle NUL bytes in popup text
Fix #25610
(cherry picked from commit 762a9e138b
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
47354c59bd
commit
9ee75f4781
@@ -2897,6 +2897,18 @@ describe('LSP', function()
|
||||
it('calculates size correctly with wrapping', function()
|
||||
eq({15,5}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents,{width = 15, wrap_at = 14})} ]])
|
||||
end)
|
||||
|
||||
it('handles NUL bytes in text', function()
|
||||
exec_lua([[ contents = {
|
||||
'\000\001\002\003\004\005\006\007\008\009',
|
||||
'\010\011\012\013\014\015\016\017\018\019',
|
||||
'\020\021\022\023\024\025\026\027\028\029',
|
||||
} ]])
|
||||
command('set list listchars=')
|
||||
eq({20,3}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents)} ]])
|
||||
command('set display+=uhex')
|
||||
eq({40,3}, exec_lua[[ return {vim.lsp.util._make_floating_popup_size(contents)} ]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('lsp.util.trim.trim_empty_lines', function()
|
||||
|
Reference in New Issue
Block a user