aboutsummaryrefslogtreecommitdiff
path: root/src/tui/ui.rs
diff options
context:
space:
mode:
authorlukeflo2025-05-25 14:21:17 +0200
committerlukeflo2025-05-25 14:21:17 +0200
commit06782b5ed1527b1d4eb6e26feb5a260415efe1af (patch)
tree33fa4c6d0eeb7ceef3dcf83d8bd034af6e74c6be /src/tui/ui.rs
parentd112312c3fcf79c679e2aa4a47a60b69f83cbce9 (diff)
downloadbibiman-06782b5ed1527b1d4eb6e26feb5a260415efe1af.tar.gz
bibiman-06782b5ed1527b1d4eb6e26feb5a260415efe1af.zip
enhancement from PR \#28 discussion
+ Collect basenames and filepaths from pdf dir into HashMap + Identical basenames in different subdirs are possible + Collected into Vector + TODO: implement selection for multiple files (yank and open)
Diffstat (limited to 'src/tui/ui.rs')
-rw-r--r--src/tui/ui.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/tui/ui.rs b/src/tui/ui.rs
index 921cbb1..883e4df 100644
--- a/src/tui/ui.rs
+++ b/src/tui/ui.rs
@@ -24,6 +24,7 @@ use crate::cliargs::CLIArgs;
use crate::config::BibiConfig;
use crate::tui::popup::PopupKind;
use crate::App;
+use itertools::Itertools;
use ratatui::layout::{Direction, Position};
use ratatui::widgets::Clear;
use ratatui::Frame;
@@ -833,15 +834,24 @@ pub fn render_selected_item(app: &mut App, cfg: &BibiConfig, frame: &mut Frame,
),
]));
}
- if cur_entry.filepath.is_some() {
+ if let Some(p) = &cur_entry.filepath {
lines.push(Line::from(vec![
Span::styled("File: ", style_value),
Span::styled(
- cur_entry.filepath().to_string_lossy(),
+ p.iter().map(|f| f.to_str().unwrap()).join("; "),
Style::new().fg(cfg.colors.main_text_color),
),
]));
}
+ // if cur_entry.filepath.is_some() {
+ // lines.push(Line::from(vec![
+ // Span::styled("File: ", style_value),
+ // Span::styled(
+ // cur_entry.filepath().to_string_lossy(),
+ // Style::new().fg(cfg.colors.main_text_color),
+ // ),
+ // ]));
+ // }
lines.push(Line::from(""));
lines.push(Line::from(vec![Span::styled(
cur_entry.abstract_text.clone(),