mirror of
https://github.com/stablyai/orca.git
synced 2026-09-30 00:03:15 +00:00
SearchEngine's forward scans walk every buffer row and _findInLine rewinds each wrapped row back to the start of its line, so a single long un-newlined line costs O(rows^2) on the renderer's main thread. The find bar re-runs that scan on every keystroke and again 200ms after every onWriteParsed, so a pane holding one long line freezes repeatedly rather than searching. A wrapped row's text was already searched when the first row of its line was, so skip it. Only sound for a plain search: wholeWord and regex can reject at one offset and match at a later one in the same line, so both keep the old walk. Measured, one un-newlined line at 80 cols filling the default 5000-row scrollback, no match (real Terminal + SearchAddon, happy-dom): upstream 17046 ms with the recursion fix 18500 ms with this commit 6 ms