mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
style(gh): cleanup
This commit is contained in:
parent
bd71cd4b00
commit
7a94861471
1 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue