fix(win): relative=cursor. Closes #427. Closes #477

This commit is contained in:
Folke Lemaitre 2025-01-16 08:45:36 +01:00
parent 4c55f1c2da
commit 743f8b3fee
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -1091,6 +1091,9 @@ function M:dim(parent)
ret.width = math.max(ret.width, self.opts.min_width or 0, 1)
ret.width = math.min(ret.width, self.opts.max_width or ret.width, parent.width)
if self.opts.relative == "cursor" then
ret.row, ret.col = ret.row or 0, ret.col or 0
end
ret.row = pos(self.opts.row, ret.height, parent.height, border.top, border.bottom)
ret.col = pos(self.opts.col, ret.width, parent.width, border.left, border.right)