Skip to content

Commit

Permalink
defer after input
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed Dec 28, 2024
1 parent f290950 commit 0a0c68f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions nvim/.config/nvim/lua/plugins/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ local actions = function()
['Delete tag'] = git_funcs.ui_select_delete_tag,
['Find in all commits'] = function()
local rev_list = vim.fn.FugitiveExecute({ 'rev-list', '--all' }).stdout
vim.ui.input({ prompt = 'Enter search term: ' }, function(search_term)
if not search_term then
git_funcs.prnt 'Canceled.'
return
end
git_funcs.prnt('Searching for ' .. search_term .. ' in all commits...')
vim.cmd('silent Ggrep ' .. vim.fn.fnameescape(search_term) .. ' ' .. table.concat(rev_list, ' '))
end)
vim.defer_fn(function()
vim.ui.input({ prompt = 'Enter search term: ' }, function(search_term)
if not search_term then
git_funcs.prnt 'Canceled.'
return
end
git_funcs.prnt('Searching for ' .. search_term .. ' in all commits...')
vim.cmd('silent Ggrep ' .. vim.fn.fnameescape(search_term) .. ' ' .. table.concat(rev_list, ' '))
end)
end, 100)
end,
['Push (:Gp)'] = git_funcs.push,
['Pull (:Gl)'] = git_funcs.pull,
Expand Down

0 comments on commit 0a0c68f

Please sign in to comment.