From 06782b5ed1527b1d4eb6e26feb5a260415efe1af Mon Sep 17 00:00:00 2001 From: lukeflo Date: Sun, 25 May 2025 14:21:17 +0200 Subject: 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) --- src/tui/ui.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/tui/ui.rs') 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(), -- cgit v1.2.3