Implement done command

This commit is contained in:
Joscha 2021-12-14 22:37:27 +01:00
parent 0de89bd424
commit b476a95afb
6 changed files with 67 additions and 20 deletions

View file

@ -115,23 +115,16 @@ impl ShowLines {
}
}
pub fn show_all(layout: &LineLayout) -> String {
pub fn show_all(layout: &LineLayout) {
let num_width = cmp::max(layout.num_width(), 3); // `now` is 3 chars wide
let mut show_lines = ShowLines::new(num_width, layout.span_width());
for line in layout.lines() {
show_lines.display_line(line);
}
show_lines.result()
print!("{}", show_lines.result());
}
pub fn show_entry(
files: &Files,
entries: &[Entry],
layout: &LineLayout,
number: usize,
) -> Result<()> {
let index = layout.look_up_number(number)?;
let entry = &entries[index];
pub fn show_entry(files: &Files, entry: &Entry) -> Result<()> {
let command = files.command(entry.source);
match entry.kind {