File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ use crate::{
22
22
23
23
#[ derive( Default ) ]
24
24
pub enum DataState {
25
- Loading ,
26
- NoResults ,
27
25
#[ default]
28
26
Blank ,
27
+ Loading ,
28
+ NoResults ,
29
29
HasResults ( Rows ) ,
30
30
Error ( DbError ) ,
31
31
Cancelled ,
@@ -201,13 +201,22 @@ impl<'a> Component for Data<'a> {
201
201
self . scrollable . draw ( f, area, app_state) ?;
202
202
} ,
203
203
DataState :: Error ( e) => {
204
- f. render_widget ( Paragraph :: new ( e. to_string ( ) ) . wrap ( Wrap { trim : false } ) . block ( block) , area) ;
204
+ f. render_widget (
205
+ Paragraph :: new ( e. to_string ( ) ) . style ( Style :: default ( ) . fg ( Color :: Red ) ) . wrap ( Wrap { trim : false } ) . block ( block) ,
206
+ area,
207
+ ) ;
205
208
} ,
206
209
DataState :: Loading => {
207
- f. render_widget ( Paragraph :: new ( "loading..." ) . wrap ( Wrap { trim : false } ) . block ( block) , area) ;
210
+ f. render_widget (
211
+ Paragraph :: new ( Text :: from ( "loading..." ) . fg ( Color :: Green ) ) . wrap ( Wrap { trim : false } ) . block ( block) ,
212
+ area,
213
+ ) ;
208
214
} ,
209
215
DataState :: Cancelled => {
210
- f. render_widget ( Paragraph :: new ( "query cancelled." ) . wrap ( Wrap { trim : false } ) . block ( block) , area) ;
216
+ f. render_widget (
217
+ Paragraph :: new ( Text :: from ( "query cancelled." ) . fg ( Color :: Yellow ) ) . wrap ( Wrap { trim : false } ) . block ( block) ,
218
+ area,
219
+ ) ;
211
220
} ,
212
221
}
213
222
Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ mod tests {
444
444
let c = Config :: new ( ) ?;
445
445
assert_eq ! (
446
446
c. keybindings. get( & Focus :: Menu ) . unwrap( ) . get( & parse_key_sequence( "<q>" ) . unwrap_or_default( ) ) . unwrap( ) ,
447
- & Action :: Quit
447
+ & Action :: AbortQuery
448
448
) ;
449
449
Ok ( ( ) )
450
450
}
You can’t perform that action at this time.
0 commit comments