fix(terminal): dont overwrite user opts

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

View file

@ -62,13 +62,9 @@ local terminals = {}
---@param opts? snacks.terminal.Opts
function M.open(cmd, opts)
local id = vim.v.count1
opts = Snacks.config.get(
"terminal",
defaults --[[@as snacks.terminal.Opts]],
{ win = { position = cmd and "float" or "bottom" } },
opts
)
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.wo.winbar = opts.win.wo.winbar or (opts.win.position == "float" and "" or (id .. ": %{b:term_title}"))
if opts.override then