feat: Add git builtins (#240)

Conni2461 is a great coder and contributor :)
This commit is contained in:
Simon Hauser
2020-11-16 21:10:26 +01:00
committed by GitHub
parent c01b7ad024
commit 8117263027
5 changed files with 241 additions and 33 deletions

View File

@@ -189,9 +189,22 @@ actions.insert_value = function(prompt_bufnr)
return entry.value
end
actions.git_checkout = function(prompt_bufnr)
local selection = actions.get_selected_entry(prompt_bufnr)
actions.close(prompt_bufnr)
local val = selection.value
os.execute('git checkout ' .. val)
end
actions.git_add = function(prompt_bufnr)
local selection = actions.get_selected_entry(prompt_bufnr)
actions.close(prompt_bufnr)
local val = selection.value
os.execute('git add ' .. val)
end
-- ==================================================
-- Transforms modules and sets the corect metatables.
-- ==================================================
actions = transform_mod(actions)
return actions