fix(win): better winfixheight and winfixwidth for splits

This commit is contained in:
Folke Lemaitre 2024-11-06 23:06:36 +01:00
parent 79295fbb29
commit 8be14c68a7
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -37,7 +37,7 @@ local defaults = {
position = "float",
minimal = true,
wo = {
winhighlight = "Normal:SnacksNormal,NormalNC:SnacksWinBarNC,WinBar:SnacksWinBar,WinBarNC:SnacksWinBarNC",
winhighlight = "Normal:SnacksNormal,NormalNC:SnacksNormalNC,WinBar:SnacksWinBar,WinBarNC:SnacksWinBarNC",
},
bo = {},
keys = {
@ -73,8 +73,6 @@ Snacks.config.style("minimal", {
spell = false,
winbar = "",
statuscolumn = "",
winfixheight = true,
winfixwidth = true,
wrap = false,
},
})
@ -163,6 +161,9 @@ function M.new(opts)
opts = M.resolve("float", opts)
else
opts = M.resolve("split", opts)
local vertical = opts.position == "left" or opts.position == "right"
opts.wo.winfixheight = not vertical
opts.wo.winfixwidth = vertical
end
---@cast opts snacks.win.Config
self.opts = opts