File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,12 +296,12 @@ impl App {
296296 self . error_output_opt = None
297297 }
298298 UiCmd :: ScrollDown => {
299- let max_offset = self . main_output ( ) . lines . len ( ) as u16 - self . output_height ;
300- self . offset . y = self . offset . y . saturating_add ( 1 ) . min ( max_offset) ;
299+ let max_offset = self . main_output ( ) . lines . len ( ) . saturating_sub ( self . output_height as usize ) ;
300+ self . offset . y = self . offset . y . saturating_add ( 1 ) . min ( max_offset as u16 ) ;
301301 }
302302 UiCmd :: ScrollDownPage => {
303- let max_offset = self . main_output ( ) . lines . len ( ) as u16 - self . output_height ;
304- self . offset . y = self . offset . y . saturating_add ( 10 ) . min ( max_offset) ;
303+ let max_offset = self . main_output ( ) . lines . len ( ) . saturating_sub ( self . output_height as usize ) ;
304+ self . offset . y = self . offset . y . saturating_add ( 10 ) . min ( max_offset as u16 ) ;
305305 }
306306 UiCmd :: ScrollUp => {
307307 self . offset . y = self . offset . y . saturating_sub ( 1 ) ;
You can’t perform that action at this time.
0 commit comments