ZIm/crates/editor/src
Thorsten Ball 0a78c67647 Improve performance of select-all-matches
This fixes #6440.

The previous approach was calling select-next-match in a loop, which
leaves optimizations on the table when you already know that you want to
select all of the matches.

So what we did here is to optimize the code for the "give me all
matches" case:

1. Find all results in the current buffer
2. Build up *all* selections
3. Sort selections & throw away overlapping ones (keep oldest)
4. Unfold if necessary
5. Render selections

On my M3 Max searching for `<span` in the test file [1] from the ticket,
it

previously took: ~1.07s
now takes: ~4ms

[1]: https://github.com/standardebooks/edgar-allan-poe_poetry/blob/master/src/epub/text/poetry.xhtml

Co-authored-by: Antonio <antonio@zed.dev>
2024-01-25 13:35:22 +01:00
..
display_map Fix rendering of diagnostic blocks 2024-01-23 16:28:58 -07:00
scroll Editor docs (#4097) 2024-01-18 00:48:37 +01:00
test gpui: Further docs refinement & moved some reexports into 'private' module (#3935) 2024-01-07 14:14:21 +01:00
actions.rs Improve performance of select-all-matches 2024-01-25 13:35:22 +01:00
blink_manager.rs Remove 2 suffix for editor 2024-01-03 10:58:57 -08:00
display_map.rs Start documenting display_map module 2024-01-18 16:38:06 +01:00
editor.rs Improve performance of select-all-matches 2024-01-25 13:35:22 +01:00
editor_settings.rs Display setting documentation in settings.json (#3936) 2024-01-08 19:30:18 +01:00
editor_tests.rs Improve performance of select-all-matches 2024-01-25 13:35:22 +01:00
element.rs Use the correct snapshot when calculating mouse positions 2024-01-24 19:10:53 -07:00
git.rs Track read_only per project and buffer 2024-01-03 19:31:43 -07:00
highlight_matching_bracket.rs Remove 2 suffix for editor 2024-01-03 10:58:57 -08:00
hover_popover.rs One off 2024-01-22 15:53:12 -07:00
inlay_hint_cache.rs Add typo detection to CI (#4107) 2024-01-17 17:13:47 -08:00
items.rs Fix scroll jitter by ignoring autoscroll events if following 2024-01-23 16:16:21 +01:00
link_go_to_definition.rs Editor docs (#4097) 2024-01-18 00:48:37 +01:00
mouse_context_menu.rs Remove 2 suffix for editor 2024-01-03 10:58:57 -08:00
movement.rs Editor docs (#4097) 2024-01-18 00:48:37 +01:00
persistence.rs wip 2023-01-25 11:32:19 -08:00
rust_analyzer_ext.rs Remove 2 suffix for editor 2024-01-03 10:58:57 -08:00
scroll.rs Fix horizontal scroll going too far to the left 2024-01-23 12:28:50 +01:00
selections_collection.rs Editor docs (#4097) 2024-01-18 00:48:37 +01:00
test.rs Remove some todo!'s 2024-01-09 11:36:36 +02:00