diff --git a/lua/git/status_view.lua b/lua/git/status_view.lua index ed842c0..059ba47 100644 --- a/lua/git/status_view.lua +++ b/lua/git/status_view.lua @@ -662,7 +662,10 @@ local function set_keymaps(bufnr, placement) end end ----@param opts? { placement: ow.Git.StatusView.Placement? } +---@class ow.Git.StatusView.OpenOpts +---@field placement ow.Git.StatusView.Placement? + +---@param opts? ow.Git.StatusView.OpenOpts function M.open(opts) opts = opts or {} local placement = opts.placement or "sidebar" @@ -765,13 +768,14 @@ function M.read_uri(buf) r:refresh() end -function M.toggle() +---@param opts? ow.Git.StatusView.OpenOpts +function M.toggle(opts) local existing = find_view() if existing then vim.api.nvim_win_close(existing, false) return end - M.open({ placement = "sidebar" }) + M.open(opts) end return M