editor: Shrink DisplayMapSnapshot from 824 to 256 bytes (#39568)

We have unnecessary clones for the fields here as most of the snapshots
contain the others hierarchically.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-10-06 08:08:49 +00:00
committed by GitHub
parent 9c7369f54d
commit 2bfcd60b88
48 changed files with 594 additions and 543 deletions
+2 -2
View File
@@ -251,7 +251,7 @@ impl ScrollManager {
Bias::Left,
)
.to_point(map);
let top_anchor = map.buffer_snapshot.anchor_after(scroll_top_buffer_point);
let top_anchor = map.buffer_snapshot().anchor_after(scroll_top_buffer_point);
self.set_anchor(
ScrollAnchor {
@@ -550,7 +550,7 @@ impl Editor {
let snapshot = self.snapshot(window, cx).display_snapshot;
let new_screen_top = DisplayPoint::new(row, 0);
let new_screen_top = new_screen_top.to_offset(&snapshot, Bias::Left);
let new_anchor = snapshot.buffer_snapshot.anchor_before(new_screen_top);
let new_anchor = snapshot.buffer_snapshot().anchor_before(new_screen_top);
self.set_scroll_anchor(
ScrollAnchor {