Skip to content

Commit 86fc573

Browse files
committed
Remove the footer separators
1 parent 75a38fa commit 86fc573

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/list/state.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub struct ListState<'a> {
4343
filter: Filter,
4444
term_width: u16,
4545
term_height: u16,
46-
separator_line: Vec<u8>,
4746
show_footer: bool,
4847
}
4948

@@ -76,7 +75,6 @@ impl<'a> ListState<'a> {
7675
// Set by `set_term_size`
7776
term_width: 0,
7877
term_height: 0,
79-
separator_line: Vec::new(),
8078
show_footer: true,
8179
};
8280

@@ -95,14 +93,10 @@ impl<'a> ListState<'a> {
9593
}
9694

9795
let header_height = 1;
98-
// 2 separators, 1 progress bar, 2 footer message lines.
99-
let footer_height = 5;
96+
// 1 progress bar, 2 footer message lines.
97+
let footer_height = 3;
10098
self.show_footer = height > header_height + footer_height;
10199

102-
if self.show_footer {
103-
self.separator_line = "─".as_bytes().repeat(width as usize);
104-
}
105-
106100
self.scroll_state.set_max_n_rows_to_display(
107101
height.saturating_sub(header_height + u16::from(self.show_footer) * footer_height)
108102
as usize,
@@ -202,9 +196,6 @@ impl<'a> ListState<'a> {
202196
}
203197

204198
if self.show_footer {
205-
stdout.write_all(&self.separator_line)?;
206-
next_ln(stdout)?;
207-
208199
progress_bar(
209200
&mut MaxLenWriter::new(stdout, self.term_width as usize),
210201
self.app_state.n_done(),
@@ -213,9 +204,6 @@ impl<'a> ListState<'a> {
213204
)?;
214205
next_ln(stdout)?;
215206

216-
stdout.write_all(&self.separator_line)?;
217-
next_ln(stdout)?;
218-
219207
let mut writer = MaxLenWriter::new(stdout, self.term_width as usize);
220208
if self.message.is_empty() {
221209
// Help footer message

0 commit comments

Comments
 (0)