mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
If a search has many matches, scrolling the view becomes laggy. For example, a search for "e" in a long branch log can find 44000 matches. With that many, drawing a 100x40 view takes 40ms, where it takes 0.14ms without a search. For every cell it draws, draw looks through all the matches to see if the cell is part of one. The matches are sorted in the same order as draw visits the cells, so let draw step through them along with the cells. It finds the first match on screen with a binary search. Drawing that view now takes 0.14ms with or without a search. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>