fix(win): dont center float when relative="cursor"

This commit is contained in:
Folke Lemaitre 2024-11-07 14:32:18 +01:00
parent 107d10b52e
commit 4991e347dc
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -474,6 +474,9 @@ function M:win_opts()
opts.height = math.floor(opts.height < 1 and parent.height * opts.height or opts.height)
opts.width = math.floor(opts.width < 1 and parent.width * opts.width or opts.width)
if opts.relative == "cursor" then
return opts
end
opts.row = opts.row or math.floor((parent.height - opts.height) / 2)
opts.col = opts.col or math.floor((parent.width - opts.width) / 2)
return opts