mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Account for trailing below blocks in BlockSnapshot::max_point
This commit is contained in:
parent
d6bc05cad0
commit
b6e6dafca7
2 changed files with 8 additions and 6 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue