mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(picker): set correct cwd for git status picker (#505)
## Description Cwd was wrong for git status picker. ## Related Issue(s) - Fixes #504
This commit is contained in:
parent
cf38082828
commit
2cc7cf42e9
1 changed files with 2 additions and 1 deletions
|
@ -86,13 +86,14 @@ function M.status(opts)
|
|||
}
|
||||
|
||||
local cwd = vim.fs.normalize(opts and opts.cwd or uv.cwd() or ".") or nil
|
||||
local git_root = vim.fs.root(cwd, ".git")
|
||||
return require("snacks.picker.source.proc").proc(vim.tbl_deep_extend("force", {
|
||||
cmd = "git",
|
||||
args = args,
|
||||
---@param item snacks.picker.finder.Item
|
||||
transform = function(item)
|
||||
local status, file = item.text:sub(1, 2), item.text:sub(4)
|
||||
item.cwd = cwd
|
||||
item.cwd = git_root
|
||||
item.status = status
|
||||
item.file = file
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue