File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,19 +179,12 @@ impl OutputWidget {
179179 pub fn handle_ui_command ( & mut self , ui_cmd : UiCmd ) {
180180 match ui_cmd {
181181 UiCmd :: ScrollDown => {
182- let max_offset = self
183- . main_output ( )
184- . lines
185- . len ( )
186- . saturating_sub ( self . output_height as usize ) ;
182+ let max_offset = self . main_output ( ) . lines . len ( ) . saturating_sub ( 1 ) ; // keep at least one line visible
183+
187184 self . offset . y = self . offset . y . saturating_add ( 1 ) . min ( max_offset) ;
188185 }
189186 UiCmd :: ScrollDownPage => {
190- let max_offset = self
191- . main_output ( )
192- . lines
193- . len ( )
194- . saturating_sub ( self . output_height as usize ) ;
187+ let max_offset = self . main_output ( ) . lines . len ( ) . saturating_sub ( 1 ) ; // keep at least one line visible
195188
196189 let page_size = self . output_height as usize / 2 ;
197190 self . offset . y = self . offset . y . saturating_add ( page_size) . min ( max_offset) ;
@@ -274,15 +267,6 @@ impl Widget for &mut OutputWidget {
274267
275268 self . output_height = output_content_area. height ; // save this value for scroll logic
276269
277- // it screen was resized (height increased) then adjust current offset
278- let current_max_y_offset = self
279- . main_output ( )
280- . len ( )
281- . saturating_sub ( output_content_area. height as usize ) ;
282- if self . offset . y > current_max_y_offset {
283- self . offset . y = current_max_y_offset
284- }
285-
286270 if matches ! ( self . error_display_mode, ErrorDisplayMode :: Pane ) {
287271 if let Some ( err_output) = & self . error_output_opt {
288272 let block = Block :: bordered ( )
You can’t perform that action at this time.
0 commit comments