fix(lazygit): allow extensible user args (#789)

## Description
Currently `opts.args` are set to a specific value. Allow users to
optionally pass their own additional args.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
This commit is contained in:
Iordanis Petkakis 2025-10-19 08:42:25 +03:00 committed by GitHub
parent eea7dccfde
commit da655a3538
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,11 +215,11 @@ function M.log(opts)
end
-- Opens lazygit with the log of the current file
---@param opts? snacks.lazygit.Config
---@param opts? snacks.lazygit.Config|{}
function M.log_file(opts)
local file = vim.trim(vim.api.nvim_buf_get_name(0))
opts = opts or {}
opts.args = { "-f", file }
opts.args = vim.list_extend(opts.args or {}, { "-f", file })
opts.cwd = vim.fn.fnamemodify(file, ":h")
return M.open(opts)
end