mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 05:57:38 -04:00
An external diff command rides on the git command as a diff.external config, which means it is fixed when the command is built. That is before the layout pass, so the width the renderer is to lay out for isn't known yet, and the command can't be told about it. Pass it as GIT_EXTERNAL_DIFF from the render instead, where the width is known and where a stdin filter is already handed to git the same way. git ranks the variable exactly as it ranks the config, behind a per-path diff driver from .gitattributes, so a repository that defines one still gets it (verified on git 2.22.5 and 2.55). An empty command means the user wants their own git config to apply, so leave the variable unset for that; git takes it being set at all as an instruction. The renderer command leaves the git arguments, so it also leaves the key that says which diff a render is of. Cycling between two external diff renderers now keeps the view's place, the way cycling between two stdin filters already does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>