mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 05:57:38 -04:00
onMouseMove (and findHyperlinkAt, which it calls) read v.viewLines without holding writeMutex, unlike every other reader. They run on the event-handling goroutine, so a re-render on the task goroutine can shrink or rebuild viewLines between onMouseMove's bounds check and findHyperlinkAt's indexing, causing an out-of-range panic (observed: "index out of range [60] with length 0" while hovering during a diff re-render). Take writeMutex for the duration, like the other viewLines readers do, so the check and the access see the same slice. Pre-existing, but the off-screen re-render rebuilds viewLines on the task goroutine more often, widening the window.