Get Editor compiling with MultiBuffer as its buffer

There's a bunch of unimplemented methods in MultiBuffer, but everything compiles.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2021-12-08 19:23:04 -07:00
parent daedf179b2
commit 87d16c271e
18 changed files with 931 additions and 450 deletions

View file

@ -1850,13 +1850,13 @@ impl BufferSnapshot {
self.visible_text.clip_point_utf16(point, bias)
}
pub fn point_for_offset(&self, offset: usize) -> Result<Point> {
if offset <= self.len() {
Ok(self.text_summary_for_range(0..offset))
} else {
Err(anyhow!("offset out of bounds"))
}
}
// pub fn point_for_offset(&self, offset: usize) -> Result<Point> {
// if offset <= self.len() {
// Ok(self.text_summary_for_range(0..offset))
// } else {
// Err(anyhow!("offset out of bounds"))
// }
// }
pub fn edits_since<'a, D>(
&'a self,