Skip to content

Commit

Permalink
fix: the height of docs view get wrong when content lines get wrapped
Browse files Browse the repository at this point in the history
When the wrap_at option not pass to vim.lsp.util._make_floating_popup_size(),
it calculates height with unwrapped lines.
Actually the nvim-cmp shows content with wrapped lines in docs view.
So when the content has very long text, the calculated height is smaller than
actually required in docs view.
  • Loading branch information
adoyle-h committed Sep 1, 2024
1 parent ae644fe commit 90e60d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/cmp/view/docs_view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ docs_view.open = function(self, e, view)
local opts = {
max_width = max_width - border_info.horiz,
}
opts.wrap_at = opts.max_width
if documentation.max_height > 0 then
opts.max_height = documentation.max_height
end
Expand All @@ -71,6 +72,7 @@ docs_view.open = function(self, e, view)
local opts = {
max_width = max_width - border_info.horiz,
}
opts.wrap_at = opts.max_width
if documentation.max_height > 0 then
opts.max_height = documentation.max_height - border_info.vert
end
Expand Down

0 comments on commit 90e60d2

Please sign in to comment.