mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
feat(picker): added git_branches
picker. Closes #614
This commit is contained in:
parent
903431903b
commit
8563dfce68
8 changed files with 196 additions and 7 deletions
|
@ -126,6 +126,22 @@ M.files = {
|
|||
supports_live = true,
|
||||
}
|
||||
|
||||
M.git_branches = {
|
||||
finder = "git_branches",
|
||||
format = "git_branch",
|
||||
preview = "git_log",
|
||||
confirm = "git_checkout",
|
||||
on_show = function(picker)
|
||||
for i, item in ipairs(picker:items()) do
|
||||
if item.current then
|
||||
picker.list:view(i)
|
||||
Snacks.picker.actions.list_scroll_center(picker)
|
||||
break
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
-- Find git files
|
||||
---@class snacks.picker.git.files.Config: snacks.picker.Config
|
||||
---@field untracked? boolean show untracked files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue