Rename Cursor::{start,end} to Cursor::{sum_start,sum_end}

This commit is contained in:
Antonio Scandurra
2021-06-10 14:06:27 +02:00
parent dc2805bb14
commit 742241a903
5 changed files with 58 additions and 55 deletions
+2 -2
View File
@@ -131,7 +131,7 @@ impl Rope {
let mut cursor = self.chunks.cursor::<usize, Point>();
cursor.seek(&offset, Bias::Left, &());
let overshoot = offset - cursor.seek_start();
*cursor.start()
*cursor.sum_start()
+ cursor
.item()
.map_or(Point::zero(), |chunk| chunk.to_point(overshoot))
@@ -142,7 +142,7 @@ impl Rope {
let mut cursor = self.chunks.cursor::<Point, usize>();
cursor.seek(&point, Bias::Left, &());
let overshoot = point - cursor.seek_start();
cursor.start() + cursor.item().map_or(0, |chunk| chunk.to_offset(overshoot))
cursor.sum_start() + cursor.item().map_or(0, |chunk| chunk.to_offset(overshoot))
}
pub fn clip_offset(&self, mut offset: usize, bias: Bias) -> usize {