Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lua/git-dev/pickers/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ local P = {
end,
-- Action on selection
select_entry = function(entry)
if entry then
require("git-dev").open(
entry.args.repo,
entry.args.ref,
entry.args.opts
)
end
vim.schedule(function()
if entry then
require("git-dev").open(
entry.args.repo,
entry.args.ref,
entry.args.opts
)
end
end)
end,
-- An array of an entry text parts
label_parts = function(entry)
Expand Down
5 changes: 4 additions & 1 deletion lua/git-dev/pickers/mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ function pickers.history(local_opts)
source = {
name = config.title,
items = config.get_entries,
choose = config.select_entry,
choose = function(item)
minipick.stop()
config.select_entry(item)
end,
show = function(buf_id, items)
local widths = picker_utils.normalize_width(
vim.fn.winwidth(0), -- should deduct separator width
Expand Down
5 changes: 4 additions & 1 deletion lua/git-dev/pickers/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ function pickers.history(local_opts)
source = "git-dev",
title = config.title,
items = config.get_entries(),
confirm = function(_, item)
confirm = function(picker, item)
if picker then
picker:close()
end
config.select_entry(item)
end,
format = function(item, p)
Expand Down
Loading