diff --git a/lua/octo/commands.lua b/lua/octo/commands.lua index 8cdd7aad..a0f8495f 100644 --- a/lua/octo/commands.lua +++ b/lua/octo/commands.lua @@ -216,6 +216,11 @@ function M.setup() local bufnr = vim.api.nvim_get_current_buf() local buffer = octo_buffers[bufnr] if not buffer or not buffer:isPullRequest() then + picker.prs { + cb = function(selected) + utils.checkout_pr(selected.obj.number) + end, + } return end if not utils.in_pr_repo() then diff --git a/lua/octo/pickers/fzf-lua/pickers/prs.lua b/lua/octo/pickers/fzf-lua/pickers/prs.lua index 90ae3e23..96a6b1f0 100644 --- a/lua/octo/pickers/fzf-lua/pickers/prs.lua +++ b/lua/octo/pickers/fzf-lua/pickers/prs.lua @@ -12,11 +12,21 @@ local function checkout_pull_request(entry) utils.checkout_pr(entry.obj.number) end +local function not_implemented() + utils.error "Not implemented yet" +end + return function(opts) opts = opts or {} if not opts.states then opts.states = "OPEN" end + + if opts.cb ~= nil then + not_implemented() + return + end + local filter = picker_utils.get_filter(opts, "pull_request") if utils.is_blank(opts.repo) then opts.repo = utils.get_remote_name()