aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorLW <git@llllvvuu.dev>2023-10-08 01:09:25 -0700
committerGitHub <noreply@github.com>2023-10-08 10:09:25 +0200
commit9abced6ad95f6300ae80cd8b8aa124ebcf511b50 (patch)
tree385c408707033460a7e3c36b949e58e729a3f346 /runtime/lua/vim/lsp/util.lua
parent6823fdb20b1330142506410a62474166f646bf13 (diff)
downloadrneovim-9abced6ad95f6300ae80cd8b8aa124ebcf511b50.tar.gz
rneovim-9abced6ad95f6300ae80cd8b8aa124ebcf511b50.tar.bz2
rneovim-9abced6ad95f6300ae80cd8b8aa124ebcf511b50.zip
fix(lsp): account for border height in max floating popup height (#25539)
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index a4c8959b99..ec0a1b0ab0 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -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