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
+5 -5
View File
@@ -59,7 +59,7 @@ impl StackTraceView {
editor
.snapshot(window, cx)
.buffer_snapshot
.buffer_snapshot()
.excerpt_containing(position..position)
.map(|excerpt| excerpt.id())
});
@@ -259,7 +259,7 @@ impl StackTraceView {
let mut is_first = true;
for (_, highlight) in self.highlights.iter().skip(active_idx) {
let position = highlight.to_point(&snapshot.buffer_snapshot);
let position = highlight.to_point(&snapshot.buffer_snapshot());
let color = if is_first {
is_first = false;
first_color
@@ -268,11 +268,11 @@ impl StackTraceView {
};
let start = snapshot
.buffer_snapshot
.buffer_snapshot()
.clip_point(Point::new(position.row, 0), Bias::Left);
let end = start + Point::new(1, 0);
let start = snapshot.buffer_snapshot.anchor_before(start);
let end = snapshot.buffer_snapshot.anchor_before(end);
let start = snapshot.buffer_snapshot().anchor_before(start);
let end = snapshot.buffer_snapshot().anchor_before(end);
editor.highlight_rows::<DebugStackFrameLine>(
start..end,
color,