mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 05:57:38 -04:00
Each side of a file's diff has a pane of its own, and a pane is only shown while its side has something in it. So anything that empties the side the focus is on takes that pane away with it: committing what was staged, or a commit or a discard happening outside lazygit and arriving with a refresh. The focus was left on a pane that isn't there any more, where the next keypress acted on nothing. The render is what decides which panes are shown, so the question is asked there, of every render rather than of the handful of actions that could think to ask it themselves. The pane the focus moves into gets its selection once that render has finished and there is something to put one on, the way focusing it by hand would — and shows none until then, so that the selection it was left with the last time it was used doesn't appear for a frame. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>