Reduce display_map snapshot creation (#39354)
Re-applies https://github.com/zed-industries/zed/pull/30840 This PR re-applies the initial [PR](https://github.com/zed-industries/zed/pull/30840). As it was closed because it was hard to land, because of the many conflicts. This PR re-applies the changes for it. In several cases we were creating multiple display_map snapshots within the same root-level function call. Creating a display_map snapshot is quite slow, and in some cases we were creating the snapshot multiple times. Release Notes: - N/A
This commit is contained in:
@@ -108,7 +108,7 @@ pub fn assert_text_with_selections(
|
||||
assert_eq!(editor.text(cx), unmarked_text, "text doesn't match");
|
||||
let actual = generate_marked_text(
|
||||
&editor.text(cx),
|
||||
&editor.selections.ranges(cx),
|
||||
&editor.selections.ranges(&editor.display_snapshot(cx)),
|
||||
marked_text.contains("«"),
|
||||
);
|
||||
assert_eq!(actual, marked_text, "Selections don't match");
|
||||
|
||||
Reference in New Issue
Block a user