fix(gh): force fancy diff style for gh pr diff, since that's needed to render/interact with review comments

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

View file

@ -141,12 +141,15 @@ function M.diff(opts, ctx)
if opts.repo then
vim.list_extend(args, { "--repo", opts.repo })
end
opts.previewers.diff.style = "fancy"
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 })
local annotations = Render.annotations(item)
local annotations = ctx.async:schedule(function()
return Render.annotations(item)
end)
Diff.diff(
ctx:opts({