@@ -44,7 +44,6 @@ pub struct ListState<'a> {
4444 term_width : u16 ,
4545 term_height : u16 ,
4646 separator_line : Vec < u8 > ,
47- narrow_term : bool ,
4847 show_footer : bool ,
4948}
5049
@@ -78,7 +77,6 @@ impl<'a> ListState<'a> {
7877 term_width : 0 ,
7978 term_height : 0 ,
8079 separator_line : Vec :: new ( ) ,
81- narrow_term : false ,
8280 show_footer : true ,
8381 } ;
8482
@@ -96,13 +94,9 @@ impl<'a> ListState<'a> {
9694 return ;
9795 }
9896
99- let wide_help_footer_width = 95 ;
100- // The help footer is shorter when nothing is selected.
101- self . narrow_term = width < wide_help_footer_width && self . scroll_state . selected ( ) . is_some ( ) ;
102-
10397 let header_height = 1 ;
104- // 2 separator , 1 progress bar, 1- 2 footer message.
105- let footer_height = 4 + u16 :: from ( self . narrow_term ) ;
98+ // 2 separators , 1 progress bar, 2 footer message lines .
99+ let footer_height = 5 ;
106100 self . show_footer = height > header_height + footer_height;
107101
108102 if self . show_footer {
@@ -227,14 +221,10 @@ impl<'a> ListState<'a> {
227221 // Help footer message
228222 if self . scroll_state . selected ( ) . is_some ( ) {
229223 writer. write_str ( "↓/j ↑/k home/g end/G | <c>ontinue at | <r>eset exercise" ) ?;
230- if self . narrow_term {
231- next_ln ( stdout) ?;
232- writer = MaxLenWriter :: new ( stdout, self . term_width as usize ) ;
224+ next_ln ( stdout) ?;
225+ writer = MaxLenWriter :: new ( stdout, self . term_width as usize ) ;
233226
234- writer. write_ascii ( b"filter " ) ?;
235- } else {
236- writer. write_ascii ( b" | filter " ) ?;
237- }
227+ writer. write_ascii ( b"<s>earch | filter " ) ?;
238228 } else {
239229 // Nothing selected (and nothing shown), so only display filter and quit.
240230 writer. write_ascii ( b"filter " ) ?;
@@ -263,17 +253,14 @@ impl<'a> ListState<'a> {
263253 }
264254
265255 writer. write_ascii ( b" | <q>uit list" ) ?;
266- next_ln ( stdout) ?;
267256 } else {
268257 writer. stdout . queue ( SetForegroundColor ( Color :: Magenta ) ) ?;
269258 writer. write_str ( & self . message ) ?;
270259 stdout. queue ( ResetColor ) ?;
271260 next_ln ( stdout) ?;
272-
273- if self . narrow_term {
274- next_ln ( stdout) ?;
275- }
276261 }
262+
263+ next_ln ( stdout) ?;
277264 }
278265
279266 stdout. queue ( EndSynchronizedUpdate ) ?. flush ( )
0 commit comments