Skip to content

Commit

Permalink
fix(terminal): dont overwrite user opts
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 7, 2024
1 parent f5602e6 commit 0b08d28
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lua/snacks/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b08d28

Please sign in to comment.