1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 22:33:52 +03:00

Really avoid underflow with apt scrolling

I thought I took care of this in 7c0536f9a3,
but I misunderstood how saturating_sub works.  I still need to clamp
it within range.
This commit is contained in:
Wez Furlong 2018-02-24 20:59:44 -08:00
parent f4d3ea6e05
commit b81fb73c37

View File

@ -369,8 +369,8 @@ impl<'a> CSIParser<'a> {
&[top, bottom] => {
self.advance_by(2, params);
Some(CSIAction::SetScrollingRegion {
top: top.saturating_sub(1),
bottom: bottom.saturating_sub(1),
top: top.saturating_sub(1).max(0),
bottom: bottom.saturating_sub(1).max(0),
})
}
&[] => {