mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 05:42:03 +03:00
avoid panic if an app sets an invalid scroll region
This commit is contained in:
parent
9a5e7999da
commit
7c0536f9a3
@ -373,8 +373,8 @@ impl<'a> CSIParser<'a> {
|
||||
&[top, bottom] => {
|
||||
self.advance_by(2, params);
|
||||
Some(CSIAction::SetScrollingRegion {
|
||||
top: top - 1,
|
||||
bottom: bottom - 1,
|
||||
top: top.saturating_sub(1),
|
||||
bottom: bottom.saturating_sub(1),
|
||||
})
|
||||
}
|
||||
&[] => {
|
||||
|
@ -162,7 +162,7 @@ impl Screen {
|
||||
/// will be invalidated by inserting or removing rows!
|
||||
#[inline]
|
||||
pub fn phys_row(&self, row: VisibleRowIndex) -> PhysRowIndex {
|
||||
assert!(row >= 0);
|
||||
assert!(row >= 0, "phys_row called with negative row {}", row);
|
||||
(self.lines.len() - self.physical_rows) + row as usize
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user