Skip to content

editor: layout_search_matches allocates for all ranges #3017

Description

@zanmato

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions