Give more specific names to all snapshot and text iterator types

This commit is contained in:
Max Brunsfeld 2021-12-08 09:24:00 -08:00
parent ad33111a22
commit fa379885f1
13 changed files with 229 additions and 207 deletions

View file

@ -1,6 +1,6 @@
use sum_tree::Bias;
use crate::{rope::TextDimension, Snapshot};
use crate::{rope::TextDimension, BufferSnapshot};
use super::{AnchorRangeMap, Buffer, Point, ToOffset, ToPoint};
use std::{cmp::Ordering, ops::Range, sync::Arc};
@ -105,7 +105,7 @@ impl SelectionSet {
pub fn selections<'a, D>(
&'a self,
content: &'a Snapshot,
content: &'a BufferSnapshot,
) -> impl 'a + Iterator<Item = Selection<D>>
where
D: 'a + TextDimension<'a>,
@ -124,7 +124,7 @@ impl SelectionSet {
pub fn intersecting_selections<'a, D, I>(
&'a self,
range: Range<(I, Bias)>,
content: &'a Snapshot,
content: &'a BufferSnapshot,
) -> impl 'a + Iterator<Item = Selection<D>>
where
D: 'a + TextDimension<'a>,
@ -141,7 +141,7 @@ impl SelectionSet {
})
}
pub fn oldest_selection<'a, D>(&'a self, content: &'a Snapshot) -> Option<Selection<D>>
pub fn oldest_selection<'a, D>(&'a self, content: &'a BufferSnapshot) -> Option<Selection<D>>
where
D: 'a + TextDimension<'a>,
{
@ -156,7 +156,7 @@ impl SelectionSet {
})
}
pub fn newest_selection<'a, D>(&'a self, content: &'a Snapshot) -> Option<Selection<D>>
pub fn newest_selection<'a, D>(&'a self, content: &'a BufferSnapshot) -> Option<Selection<D>>
where
D: 'a + TextDimension<'a>,
{