Description
When searching in large documents, e.g. searching for a single letter e will yield a lot of match ranges.
layout_search_matches will allocate all of them, even though we can only show the ones that are in the visible range. https://github.com/longbridge/gpui-kit/blob/main/crates/base/src/input/base/element.rs#L800
Proposal
Find the ranges that are visible within the last_layout.visible_range_offset and only allocate and iterate over those instead of all.
Description
When searching in large documents, e.g. searching for a single letter
ewill yield a lot of match ranges.layout_search_matcheswill allocate all of them, even though we can only show the ones that are in the visible range. https://github.com/longbridge/gpui-kit/blob/main/crates/base/src/input/base/element.rs#L800Proposal
Find the ranges that are visible within the
last_layout.visible_range_offsetand only allocate and iterate over those instead of all.