feat: change the pull request handling

This commit is contained in:
2024-12-29 21:19:05 +01:00
parent f46f60b723
commit 4927f0b2ec
4 changed files with 66 additions and 21 deletions

View File

@@ -7,9 +7,9 @@
local M = {}
--------------------------------------------------------------------------
----------------------------------------------------------------------------
-- A simple completion function for the :Gitea command
--------------------------------------------------------------------------
----------------------------------------------------------------------------
function M._gitea_cmd_complete(arg_lead, cmd_line, cursor_pos)
local tokens = vim.split(cmd_line, "%s+")
@@ -47,7 +47,6 @@ function M._gitea_cmd_complete(arg_lead, cmd_line, cursor_pos)
end
-- If "pr" was selected, next subcommands can be list, create
-- (removed "open" and "merge" as subcommands)
if main_sub == "pr" then
if #tokens == 3 then
local candidates = { "list", "create" }
@@ -106,7 +105,8 @@ function M.setup_commands(core)
elseif main == "pr" then
local sub = args[2] or ""
if sub == "list" then
vim.cmd([[echo "TODO: :Gitea pr list"]])
-- :Gitea pr list
telescope_mod.list_pulls_in_telescope()
elseif sub == "create" then
vim.cmd([[echo "TODO: :Gitea pr create"]])
else
@@ -126,4 +126,4 @@ function M.setup_commands(core)
})
end
return M
return M