mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Escaping to a focused main view restored the selection by scheduling, on the next UI tick, a ReadToEnd whose callback re-selected the saved line. But ReadToEnd fires its callback synchronously when the manager has no live read channel, and the re-render task triggered by the push creates that channel later, inside its own goroutine (after stopping the previous task). If the UI tick won that race, the restore ran before any content was loaded, FocusPoint no-oped against the unloaded line, and the selection was silently dropped — intermittently, and more often under load. Thread the restore through the task instead: a thenForNextTask hook on the buffer manager, folded into the next cmd/pty task's initial-read Then, mirroring scrollToOriginYForNextTask. It runs once the task has read enough to place the selection, and can't fire before the task exists. The scroll restore already applies at the task's first paint, which precedes the initial read's end, so the origin is in place when the selection is restored. This needs interactive verification (LAZYGIT_SLOW_RENDER + a real pager); see focused-main-view-notes.md §13. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| cheatsheet | ||
| commands | ||
| common | ||
| config | ||
| constants | ||
| env | ||
| fakes | ||
| gocui | ||
| gui | ||
| i18n | ||
| integration | ||
| jsonschema | ||
| logs | ||
| snake | ||
| tasks | ||
| theme | ||
| updates | ||
| utils | ||