Return a Fold struct when querying the FoldMap

This contains a new `id` field that lets us distinguish among folds.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-11-15 17:09:59 +01:00
parent 851a60a68e
commit 3ff8c78b58
6 changed files with 87 additions and 48 deletions

View file

@ -1581,11 +1581,11 @@ impl EditorElement {
snapshot
.folds_in_range(start_anchor..end_anchor)
.map(|anchor| {
let start = anchor.start.to_point(&snapshot.buffer_snapshot);
let start = anchor.range.start.to_point(&snapshot.buffer_snapshot);
(
start.row,
start.to_display_point(&snapshot.display_snapshot)
..anchor.end.to_display_point(&snapshot),
..anchor.range.end.to_display_point(&snapshot),
)
}),
);