fix(lsp): account for border height in max floating popup height (#25539)

This commit is contained in:
LW
2023-10-08 01:09:25 -07:00
committed by GitHub
parent 6823fdb20b
commit 9abced6ad9
2 changed files with 11 additions and 2 deletions

View File

@@ -1100,13 +1100,14 @@ function M.make_floating_popup_options(width, height, opts)
anchor_below = lines_below > lines_above
end
local border_height = get_border_size(opts).height
if anchor_below then
anchor = anchor .. 'N'
height = math.min(lines_below, height)
height = math.max(math.min(lines_below - border_height, height), 0)
row = 1
else
anchor = anchor .. 'S'
height = math.min(lines_above, height)
height = math.max(math.min(lines_above - border_height, height), 0)
row = 0
end