This commit is contained in:
2024-08-12 02:16:58 +02:00
parent 692cb43e9f
commit 5905bd6b15
5 changed files with 161 additions and 24 deletions

View File

@@ -45,7 +45,7 @@ impl Entry {
self.info.push((key.to_owned(), value.to_string()));
}
pub fn add_image(&mut self, sixel_data: String) {
pub fn set_image(&mut self, sixel_data: String) {
self.image = Some(sixel_data);
}
}
@@ -64,7 +64,7 @@ fn get_input() -> Option<Action> {
}),
Err(e) => {
eprintln!("ERROR: {:#?}", e);
std::process::exit(1);
exit();
}
_ => None,
}
@@ -72,7 +72,7 @@ fn get_input() -> Option<Action> {
Ok(false) => None,
Err(e) => {
eprintln!("ERROR: {:#?}", e);
std::process::exit(1);
exit();
}
}
}
@@ -138,6 +138,9 @@ fn render(
selected: u16,
offset: u16,
) -> Result<(), io::Error> {
if entries.is_empty() {
return Ok(());
}
stdout.queue(MoveTo(0, 0))?.queue(Clear(ClearType::All))?;
for (i, entry) in entries.iter().enumerate() {
stdout