mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
fix(picker.git): use Snacks.git.get_root instead vim.fs.root for backward compatibility
This commit is contained in:
parent
f509163e39
commit
a2fb70e8ba
1 changed files with 2 additions and 2 deletions
|
@ -86,14 +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")
|
||||
cwd = Snacks.git.get_root(cwd)
|
||||
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 = git_root
|
||||
item.cwd = cwd
|
||||
item.status = status
|
||||
item.file = file
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue