mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
A render first reads enough lines to fill the view, plus the lines above the view, so that a re-render of the diff the user is scrolled into fills the view where it is. But a render of another diff, such as the diff of another commit, is shown from the top. So if the view is scrolled far down a long diff, the next diff only shows up once the lines above the view have been read as well. For a diff of a few hundred thousand lines this takes a noticeable while, especially with a diff renderer such as delta. ViewBufferManager decides whether a render keeps the view where it is (see newContentPending). So let linesToReadFromCmdTask count the lines from the top of the view and pass on how many lines are above it, and let the task add those only if it keeps the view where it is. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>