mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 00:18:33 +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
@@ -1626,7 +1626,7 @@ function M._make_floating_popup_size(contents, opts)
|
||||
if vim.tbl_isempty(line_widths) then
|
||||
for _, line in ipairs(contents) do
|
||||
local line_width = vim.fn.strdisplaywidth(line:gsub('%z', '\n'))
|
||||
height = height + math.ceil(line_width / wrap_at)
|
||||
height = height + math.max(1, math.ceil(line_width / wrap_at))
|
||||
end
|
||||
else
|
||||
for i = 1, #contents do
|
||||
|
Reference in New Issue
Block a user