style(gh): cleanup

This commit is contained in:
Folke Lemaitre 2025-11-06 17:56:29 +01:00
parent bd71cd4b00
commit 7a94861471
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -141,12 +141,16 @@ function M.diff(opts, ctx)
if opts.repo then
vim.list_extend(args, { "--repo", opts.repo })
end
opts.previewers.diff.style = "fancy"
opts.previewers.diff.style = "fancy" -- only fancy style support inline review comments
local Render = require("snacks.gh.render")
local Diff = require("snacks.picker.source.diff")
---@async
return function(cb)
local item = Api.get({ type = "pr", repo = opts.repo, number = opts.pr })
-- fetch on the main thread since rendering uses non-fast APIs
local annotations = ctx.async:schedule(function()
return Render.annotations(item)
end)
@ -159,9 +163,7 @@ function M.diff(opts, ctx)
annotations = annotations,
}),
ctx
)(function(it)
cb(it)
end)
)(cb)
end
end