diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rs index e84f3fe41d..733c3e45c0 100644 --- a/crates/editor/src/display_map/block_map.rs +++ b/crates/editor/src/display_map/block_map.rs @@ -351,7 +351,14 @@ impl BlockSnapshot { } pub fn max_point(&self) -> BlockPoint { - self.to_block_point(self.wrap_snapshot.max_point()) + let last_transform = self.transforms.last().unwrap(); + if let Some(block) = &last_transform.block { + let row = self.transforms.summary().output_rows - 1; + let column = block.text.summary().lines.column; + BlockPoint::new(row, column) + } else { + self.to_block_point(self.wrap_snapshot.max_point()) + } } pub fn clip_point(&self, point: BlockPoint, bias: Bias) -> BlockPoint { diff --git a/crates/editor/src/display_map/wrap_map.rs b/crates/editor/src/display_map/wrap_map.rs index 6faadc3d25..c40088cb00 100644 --- a/crates/editor/src/display_map/wrap_map.rs +++ b/crates/editor/src/display_map/wrap_map.rs @@ -944,11 +944,6 @@ impl WrapPoint { Self(super::Point::new(row, column)) } - #[cfg(test)] - pub fn is_zero(&self) -> bool { - self.0.is_zero() - } - pub fn row(self) -> u32 { self.0.row }