@@ -233,43 +233,80 @@ impl<'a> ListState<'a> {
233233 ) ?;
234234 next_ln ( stdout) ?;
235235
236+ let hotkey = |writer : & mut MaxLenWriter , hotkey| -> io:: Result < ( ) > {
237+ writer
238+ . stdout
239+ . queue ( SetForegroundColor ( Color :: Yellow ) ) ?
240+ . queue ( SetAttribute ( Attribute :: Bold ) ) ?;
241+ writer. write_ascii ( hotkey) ?;
242+ writer. stdout . queue ( ResetColor ) ?;
243+ Ok ( ( ) )
244+ } ;
245+
236246 let mut writer = MaxLenWriter :: new ( stdout, self . term_width as usize ) ;
237247 if self . message . is_empty ( ) {
238248 // Help footer message
239249 if self . scroll_state . selected ( ) . is_some ( ) {
240- writer. write_str ( "↓/j ↑/k home/g end/G | <c>ontinue at | <r>eset exercise" ) ?;
250+ writer. write_str ( "↓/" ) ?;
251+ hotkey ( & mut writer, b"j" ) ?;
252+ writer. write_str ( " ↑/" ) ?;
253+ hotkey ( & mut writer, b"k" ) ?;
254+ writer. write_ascii ( b" home/" ) ?;
255+ hotkey ( & mut writer, b"g" ) ?;
256+ writer. write_ascii ( b" end/" ) ?;
257+ hotkey ( & mut writer, b"G" ) ?;
258+ writer. write_ascii ( b" | " ) ?;
259+ hotkey ( & mut writer, b"c" ) ?;
260+ writer. write_ascii ( b"ontinue at | " ) ?;
261+ hotkey ( & mut writer, b"r" ) ?;
262+ writer. write_ascii ( b"eset exercise" ) ?;
241263 next_ln ( stdout) ?;
242264 writer = MaxLenWriter :: new ( stdout, self . term_width as usize ) ;
243265
244- writer. write_ascii ( b"<s>earch | filter " ) ?;
266+ hotkey ( & mut writer, b"s" ) ?;
267+ writer. write_ascii ( b"earch | filter " ) ?;
245268 } else {
246269 // Nothing selected (and nothing shown), so only display filter and quit.
247270 writer. write_ascii ( b"filter " ) ?;
248271 }
249272
250273 match self . filter {
251274 Filter :: Done => {
275+ writer. stdout . queue ( SetAttribute ( Attribute :: Underlined ) ) ?;
276+ hotkey ( & mut writer, b"d" ) ?;
252277 writer
253278 . stdout
254279 . queue ( SetForegroundColor ( Color :: Magenta ) ) ?
255280 . queue ( SetAttribute ( Attribute :: Underlined ) ) ?;
256- writer. write_ascii ( b"<d> one") ?;
281+ writer. write_str ( " one") ?;
257282 writer. stdout . queue ( ResetColor ) ?;
258- writer. write_ascii ( b"/<p>ending" ) ?;
283+ writer. write_ascii ( b"/" ) ?;
284+ hotkey ( & mut writer, b"p" ) ?;
285+ writer. write_ascii ( b"ending" ) ?;
259286 }
260287 Filter :: Pending => {
261- writer. write_ascii ( b"<d>one/" ) ?;
288+ hotkey ( & mut writer, b"d" ) ?;
289+ writer. write_ascii ( b"one/" ) ?;
290+ writer. stdout . queue ( SetAttribute ( Attribute :: Underlined ) ) ?;
291+ hotkey ( & mut writer, b"p" ) ?;
262292 writer
263293 . stdout
264294 . queue ( SetForegroundColor ( Color :: Magenta ) ) ?
265295 . queue ( SetAttribute ( Attribute :: Underlined ) ) ?;
266- writer. write_ascii ( b"<p> ending" ) ?;
296+ writer. write_ascii ( b"ending" ) ?;
267297 writer. stdout . queue ( ResetColor ) ?;
268298 }
269- Filter :: None => writer. write_ascii ( b"<d>one/<p>ending" ) ?,
299+ Filter :: None => {
300+ hotkey ( & mut writer, b"d" ) ?;
301+ writer. write_ascii ( b"one/" ) ?;
302+ hotkey ( & mut writer, b"p" ) ?;
303+ writer. write_ascii ( b"ending" ) ?;
304+ }
270305 }
271306
272- writer. write_ascii ( b" | <q>uit list" ) ?;
307+ writer. write_ascii ( b" | " ) ?;
308+ hotkey ( & mut writer, b"q" ) ?;
309+ writer. write_ascii ( b"uit list" ) ?;
273310 } else {
274311 writer. stdout . queue ( SetForegroundColor ( Color :: Magenta ) ) ?;
275312 writer. write_str ( & self . message ) ?;
0 commit comments