mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(win): dont center float when relative="cursor"
This commit is contained in:
parent
107d10b52e
commit
4991e347dc
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue