mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 03:08:13 +00:00
feat(picker.git): git_log, git_log_file, git_log_line now do git_checkout as confirm. Closes #722
This commit is contained in:
parent
14f16ceb5d
commit
e6fb5381a9
2 changed files with 6 additions and 3 deletions
|
@ -164,6 +164,9 @@ function M.git_checkout(picker, item)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local cmd = { "git", "checkout", what }
|
local cmd = { "git", "checkout", what }
|
||||||
|
if item.file then
|
||||||
|
vim.list_extend(cmd, { "--", item.file })
|
||||||
|
end
|
||||||
Snacks.picker.util.cmd(cmd, function()
|
Snacks.picker.util.cmd(cmd, function()
|
||||||
Snacks.notify("Checkout " .. what, { title = "Snacks Picker" })
|
Snacks.notify("Checkout " .. what, { title = "Snacks Picker" })
|
||||||
end, { cwd = item.cwd })
|
end, { cwd = item.cwd })
|
||||||
|
|
|
@ -167,7 +167,7 @@ M.git_log = {
|
||||||
finder = "git_log",
|
finder = "git_log",
|
||||||
format = "git_log",
|
format = "git_log",
|
||||||
preview = "git_show",
|
preview = "git_show",
|
||||||
confirm = "close",
|
confirm = "git_checkout",
|
||||||
}
|
}
|
||||||
|
|
||||||
---@type snacks.picker.git.log.Config
|
---@type snacks.picker.git.log.Config
|
||||||
|
@ -177,7 +177,7 @@ M.git_log_file = {
|
||||||
preview = "git_show",
|
preview = "git_show",
|
||||||
current_file = true,
|
current_file = true,
|
||||||
follow = true,
|
follow = true,
|
||||||
confirm = "close",
|
confirm = "git_checkout",
|
||||||
}
|
}
|
||||||
|
|
||||||
---@type snacks.picker.git.log.Config
|
---@type snacks.picker.git.log.Config
|
||||||
|
@ -187,7 +187,7 @@ M.git_log_line = {
|
||||||
preview = "git_show",
|
preview = "git_show",
|
||||||
current_line = true,
|
current_line = true,
|
||||||
follow = true,
|
follow = true,
|
||||||
confirm = "close",
|
confirm = "git_checkout",
|
||||||
}
|
}
|
||||||
|
|
||||||
M.git_status = {
|
M.git_status = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue