Compute scrollbar markers asynchronously (#10080)

Refs #9647
Fixes https://github.com/zed-industries/zed/issues/9792

This pull request moves the computation of scrollbar markers off the
main thread, to prevent them from grinding the editor to a halt when we
have a lot of them (e.g., when there are lots of search results on a
large file). With these changes we also avoid generating multiple quads
for adjacent markers, thus fixing an issue where we stop drawing other
primitives because we've drawn too many quads in the scrollbar.

Release Notes:

- Improved editor performance when displaying lots of search results,
diagnostics, or symbol highlights in the scrollbar
([#9792](https://github.com/zed-industries/zed/issues/9792)).

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Thorsten Ball
2024-04-03 12:21:17 +02:00
committed by GitHub
co-authored by Antonio Scandurra Nathan
parent 7dbcace839
commit 3a0d3cee87
26 changed files with 532 additions and 379 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ fn copy_selections_content_internal(
}
editor.highlight_background::<HighlightOnYank>(
ranges_to_highlight,
&ranges_to_highlight,
|colors| colors.editor_document_highlight_read_background,
cx,
);