mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
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:
parent
eea7dccfde
commit
da655a3538
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue