Something went wrong. Try again.
Neovim plugin for working with Github pull request comments
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940local GhPrCommand = {}
local function handle_comments_command() local gh = require('gh-pr-comments.github') local ui = require('gh-pr-comments.ui')
gh.get_pr_comments(function(comments_data, fp_comments) if comments_data == nil then return end
ui.pr_comments = comments_data
local files, count = ui.create_ui_list()
if count == 0 then require('gh-pr-comments.utils').err_notify("No comments on Github PR.") return end ui.pr_data = gh.pr_data ui.fp_comments = fp_comments local window = ui.create_main_window() vim.api.nvim_buf_set_lines(window.buf, 0, -1, false, files) end)end
local function handle_clear_command() local ui = require('gh-pr-comments.ui') ui.clear_namespace_in_curr_buf()end
function GhPrCommand.setup() vim.api.nvim_create_user_command('GhPrComments', handle_comments_command, { force = true }) vim.api.nvim_create_user_command('GhPrCommentsClear', handle_clear_command, { force = true })end
return GhPrCommand