fix(hover): clamp to max_height when computing height

This commit is contained in:
2026-04-16 02:13:15 +02:00
parent 2e908c3808
commit d0c1f7e2d8
+3 -2
View File
@@ -73,8 +73,9 @@ end
---@return integer ---@return integer
function Window:compute_height() function Window:compute_height()
local text_height = vim.api.nvim_win_text_height(self.winid, {}).all return vim.api.nvim_win_text_height(self.winid, {
return math.min(self.max_height or text_height, text_height) max_height = self.max_height,
}).all
end end
---@param callback fun() ---@param callback fun()