editor: `layout_search_matches` allocates for all ranges
Author: zanmatoCreated Sep 8, 2026Updated Sep 8, 2026
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.
Source: longbridge/gpui-component