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,8 +351,15 @@ impl BlockSnapshot {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn max_point(&self) -> BlockPoint {
|
pub fn max_point(&self) -> BlockPoint {
|
||||||
|
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())
|
self.to_block_point(self.wrap_snapshot.max_point())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn clip_point(&self, point: BlockPoint, bias: Bias) -> BlockPoint {
|
pub fn clip_point(&self, point: BlockPoint, bias: Bias) -> BlockPoint {
|
||||||
let mut cursor = self.transforms.cursor::<(OutputRow, InputRow)>();
|
let mut cursor = self.transforms.cursor::<(OutputRow, InputRow)>();
|
||||||
|
|
|
@ -944,11 +944,6 @@ impl WrapPoint {
|
||||||
Self(super::Point::new(row, column))
|
Self(super::Point::new(row, column))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
pub fn is_zero(&self) -> bool {
|
|
||||||
self.0.is_zero()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn row(self) -> u32 {
|
pub fn row(self) -> u32 {
|
||||||
self.0.row
|
self.0.row
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue