1
1
use anyhow:: { Context , Result } ;
2
2
use crossterm:: {
3
3
cursor:: { MoveTo , MoveToNextLine } ,
4
- style:: { Attribute , Color , ResetColor , SetAttribute , SetForegroundColor } ,
4
+ style:: { Attribute , Color , ResetColor , SetAttribute , SetBackgroundColor , SetForegroundColor } ,
5
5
terminal:: { self , BeginSynchronizedUpdate , Clear , ClearType , EndSynchronizedUpdate } ,
6
6
QueueableCommand ,
7
7
} ;
@@ -115,6 +115,11 @@ impl<'a> ListState<'a> {
115
115
let mut n_displayed_rows = 0 ;
116
116
for ( exercise_ind, exercise) in displayed_exercises {
117
117
if self . selected == Some ( n_displayed_rows) {
118
+ stdout. queue ( SetBackgroundColor ( Color :: Rgb {
119
+ r : 50 ,
120
+ g : 50 ,
121
+ b : 50 ,
122
+ } ) ) ?;
118
123
stdout. write_all ( "🦀" . as_bytes ( ) ) ?;
119
124
} else {
120
125
stdout. write_all ( b" " ) ?;
@@ -135,14 +140,15 @@ impl<'a> ListState<'a> {
135
140
stdout. write_all ( b"PENDING " ) ?;
136
141
}
137
142
138
- stdout. queue ( ResetColor ) ?;
143
+ stdout. queue ( SetForegroundColor ( Color :: Reset ) ) ?;
139
144
140
145
stdout. write_all ( exercise. name . as_bytes ( ) ) ?;
141
146
stdout. write_all ( & SPACE [ ..self . name_col_width + 2 - exercise. name . len ( ) ] ) ?;
142
147
143
148
stdout. write_all ( exercise. path . as_bytes ( ) ) ?;
144
149
145
150
next_ln :: < true > ( stdout) ?;
151
+ stdout. queue ( ResetColor ) ?;
146
152
n_displayed_rows += 1 ;
147
153
}
148
154
0 commit comments