@@ -6,17 +6,17 @@ use crossterm::{
66 KeyModifiers ,
77 } ,
88 execute,
9- terminal:: { disable_raw_mode , enable_raw_mode , EnterAlternateScreen , LeaveAlternateScreen } ,
9+ terminal:: { EnterAlternateScreen , LeaveAlternateScreen , disable_raw_mode , enable_raw_mode } ,
1010} ;
1111use std:: sync:: Arc ;
1212use std:: time:: { Duration , Instant } ;
1313use tui:: {
14+ Terminal ,
1415 backend:: CrosstermBackend ,
1516 layout:: { Constraint , Direction , Layout , Rect } ,
1617 style:: { Color , Modifier , Style } ,
1718 text:: { Span , Spans } ,
1819 widgets:: { Block , Borders , List , ListItem , ListState , Paragraph , Wrap } ,
19- Terminal ,
2020} ;
2121
2222const PAGE_SIZE : usize = 30 ;
@@ -352,9 +352,7 @@ fn handle_man_page_keys(app: &mut AppState, key: KeyEvent) {
352352 KeyCode :: Up => app. man_page . scroll = app. man_page . scroll . saturating_sub ( 1 ) ,
353353 KeyCode :: Down => app. man_page . scroll = app. man_page . scroll . saturating_add ( 1 ) ,
354354 KeyCode :: Home => app. man_page . scroll = 0 ,
355- KeyCode :: End => {
356- app. man_page . scroll = app. man_page . content . len ( ) . saturating_sub ( PAGE_SIZE )
357- }
355+ KeyCode :: End => app. man_page . scroll = app. man_page . content . len ( ) . saturating_sub ( PAGE_SIZE ) ,
358356 KeyCode :: PageUp => app. man_page . scroll = app. man_page . scroll . saturating_sub ( PAGE_SIZE ) ,
359357 KeyCode :: PageDown => {
360358 app. man_page . scroll = ( app. man_page . scroll + PAGE_SIZE )
@@ -445,7 +443,7 @@ fn render_ui<B: tui::backend::Backend>(f: &mut tui::Frame<B>, app: &mut AppState
445443 Constraint :: Length ( 3 ) ,
446444 Constraint :: Min ( 10 ) ,
447445 ]
448- . as_ref ( ) ,
446+ . as_ref ( ) ,
449447 )
450448 . split ( f. size ( ) ) ;
451449
@@ -463,16 +461,14 @@ fn render_status_bar<B: tui::backend::Backend>(f: &mut tui::Frame<B>, app: &AppS
463461 let status = if app. loading {
464462 format ! ( "Loading {source_label}..." )
465463 } else {
466- let x = & * format ! (
467- "RTFM // {source_label} PAGE [Tab:Switch /:Search t:Toggle Home/End]"
468- ) ;
464+ let x = & * format ! ( "RTFM // {source_label} PAGE [Tab:Switch /:Search t:Toggle Home/End]" ) ;
469465 match app. focus {
470466 Focus :: CommandList => "RTFM // COMMAND LIST [Tab:Switch Home/End]" ,
471467 Focus :: ManPage => x,
472468 Focus :: Search => "RTFM // SEARCH MODE [Enter:Apply Esc:Cancel]" ,
473469 }
474- . parse ( )
475- . unwrap ( )
470+ . parse ( )
471+ . unwrap ( )
476472 } ;
477473
478474 let status_bar = Paragraph :: new ( status)
@@ -705,4 +701,4 @@ fn syntax_highlight(line: &str) -> Vec<Span> {
705701 }
706702
707703 spans
708- }
704+ }
0 commit comments