@@ -17,10 +17,10 @@ use crossterm::{
1717use std:: { error:: Error , io} ;
1818use tui:: {
1919 backend:: { Backend , CrosstermBackend } ,
20- layout:: { Constraint , Direction , Layout , Rect } ,
20+ layout:: { Constraint , Direction , Layout , Rect } ,
2121 style:: { Color , Modifier , Style } ,
2222 text:: { Span , Spans , Text } ,
23- widgets:: { Block , Borders , List , ListItem , ListState , Paragraph , Clear } ,
23+ widgets:: { Block , Borders , Clear , List , ListItem , ListState , Paragraph } ,
2424 Frame , Terminal ,
2525} ;
2626use unicode_width:: UnicodeWidthStr ;
@@ -43,7 +43,7 @@ struct App {
4343 state : ListState ,
4444 index : Option < usize > ,
4545 stateoflist : bool ,
46- show_popup : bool ,
46+ show_popup : bool ,
4747}
4848impl App {
4949 fn next ( & mut self ) {
@@ -183,16 +183,14 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App) -> io::Result<(
183183 } else {
184184 app. input_mode = InputMode :: Normal ;
185185 }
186- } ,
187- InputMode :: Popup => {
188- match key. code {
189- KeyCode :: Char ( 'q' ) => {
190- app. input_mode = InputMode :: Select ;
191- app. show_popup = false ;
192- }
193- _=> { }
194- }
195186 }
187+ InputMode :: Popup => match key. code {
188+ KeyCode :: Char ( 'q' ) => {
189+ app. input_mode = InputMode :: Select ;
190+ app. show_popup = false ;
191+ }
192+ _ => { }
193+ } ,
196194 }
197195 }
198196 }
@@ -253,7 +251,7 @@ fn ui<B: Backend>(f: &mut Frame<B>, app: &mut App) {
253251
254252 let input = Paragraph :: new ( app. input . as_ref ( ) )
255253 . style ( match app. input_mode {
256- InputMode :: Normal | InputMode :: Select | InputMode :: Popup => Style :: default ( ) ,
254+ InputMode :: Normal | InputMode :: Select | InputMode :: Popup => Style :: default ( ) ,
257255 InputMode :: Editing => Style :: default ( ) . fg ( Color :: Yellow ) ,
258256 } )
259257 . block ( Block :: default ( ) . borders ( Borders :: ALL ) . title ( "Input" ) ) ;
0 commit comments