mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
fix(lsp): minimum height for floating popup #31990
Problem:
The floating window for hover and signature help always cuts off a few lines,
because the `_make_floating_popup_size` function counts empty lines as having
zero height.
Solution:
Ensure the height is at least 1.
(cherry picked from commit a4f575abd8
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
323c43e1c4
commit
b0b383bff9
@@ -3357,6 +3357,19 @@ describe('LSP', function()
|
||||
command('set display+=uhex')
|
||||
eq({ 40, 3 }, exec_lua [[ return {vim.lsp.util._make_floating_popup_size(contents)} ]])
|
||||
end)
|
||||
it('handles empty line', function()
|
||||
exec_lua(function()
|
||||
_G.contents = {
|
||||
'',
|
||||
}
|
||||
end)
|
||||
eq(
|
||||
{ 20, 1 },
|
||||
exec_lua(function()
|
||||
return { vim.lsp.util._make_floating_popup_size(_G.contents, { width = 20 }) }
|
||||
end)
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('lsp.util.trim.trim_empty_lines', function()
|
||||
|
Reference in New Issue
Block a user