Skip to content

Commit 823a0a2

Browse files
committed
feat: show state in list
1 parent a77d4a3 commit 823a0a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,22 @@ impl App {
200200
.max()
201201
.unwrap_or(0);
202202
let max_time_len = self.jobs.iter().map(|j| j.time.len()).max().unwrap_or(0);
203+
let max_state_compact_len = self
204+
.jobs
205+
.iter()
206+
.map(|j| j.state_compact.len())
207+
.max()
208+
.unwrap_or(0);
203209
let jobs: Vec<ListItem> = self
204210
.jobs
205211
.iter()
206212
.map(|j| {
207213
ListItem::new(Spans::from(vec![
214+
Span::styled(
215+
format!("{:<max$.max$}", j.state_compact, max = max_state_compact_len),
216+
Style::default(),
217+
),
218+
Span::raw(" "),
208219
Span::styled(&j.id, Style::default().fg(Color::Yellow)),
209220
Span::raw(" "),
210221
Span::styled(

0 commit comments

Comments
 (0)