fix(terminal): user options

This commit is contained in:
Folke Lemaitre 2024-11-07 18:04:37 +01:00
parent 0b08d280b6
commit 334895c5bb
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -63,8 +63,9 @@ local terminals = {}
function M.open(cmd, opts)
local id = vim.v.count1
opts = Snacks.config.get("terminal", defaults --[[@as snacks.terminal.Opts]], opts)
opts.win = Snacks.win.resolve("terminal", opts.win)
opts.win.position = opts.win.position or (cmd and "float" or "bottom")
opts.win = Snacks.win.resolve("terminal", {
position = cmd and "float" or "bottom",
}, opts.win)
opts.win.wo.winbar = opts.win.wo.winbar or (opts.win.position == "float" and "" or (id .. ": %{b:term_title}"))
if opts.override then