Skip to content

Commit

Permalink
perf: colorized sort,list notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
falcon71181 committed Apr 29, 2024
1 parent 28712dc commit 963ba09
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,17 @@ impl ToDo {
None => {
if task_status == 1 {
println!(
"{}: {}",
"{}: {} {}",
Yellow.bold().italic().paint(&index.to_string()),
Style::new().strikethrough().italic().paint(task_details[0])
Style::new().strikethrough().italic().paint(task_details[0]),
Green.bold().paint("")
);
} else {
println!(
"{}: {}",
"{}: {} {}",
Blue.bold().italic().paint(&index.to_string()),
&task_details[0].to_string().replace("_", " ")
&task_details[0].to_string().replace("_", " "),
Cyan.bold().paint("󰚭")
);
}
}
Expand Down Expand Up @@ -358,30 +360,32 @@ fn display_sorted(todo_lst: &Vec<String>, via_status: Option<u8>) -> () {
if via == 1 && task_status == 1 {
println!(
"{}: {}",
task_details[0],
Yellow.bold().italic().paint(task_details[0]),
Style::new().paint(task_details[1])
);
} else if via == 0 && task_status == 0 {
println!(
"{}: {}",
task_details[0],
Blue.bold().italic().paint(task_details[0]),
Style::new().paint(task_details[1])
);
}
}
None => {
if task_status == 1 {
println!(
"{}: {}",
task_details[0],
Style::new().strikethrough().paint(task_details[1])
)
} else if task_status == 0 {
"{}: {} {}",
Yellow.bold().italic().paint(task_details[0]),
Style::new().strikethrough().italic().paint(task_details[1]),
Green.bold().paint("")
);
} else {
println!(
"{}: {}",
task_details[0],
Style::new().paint(task_details[1])
)
"{}: {} {}",
Blue.bold().italic().paint(task_details[0]),
&task_details[1].to_string().replace("_", " "),
Cyan.bold().paint("󰚭")
);
}
}
}
Expand Down

0 comments on commit 963ba09

Please sign in to comment.