diff options
| author | lukeflo | 2025-06-09 16:51:36 +0200 |
|---|---|---|
| committer | lukeflo | 2025-06-09 16:51:36 +0200 |
| commit | 99349d723b48428e6e2b195dd45e8ebf04966b05 (patch) | |
| tree | 21bf2da752fc477eda96c1eb58c229d417326742 /src | |
| parent | 36a1a8bc75b44c807c3e9613f25fe8a299e5df02 (diff) | |
| download | bibiman-99349d723b48428e6e2b195dd45e8ebf04966b05.tar.gz bibiman-99349d723b48428e6e2b195dd45e8ebf04966b05.zip | |
Fix: fix expansion of tilde (`~`) into home dir
Diffstat (limited to 'src')
| -rw-r--r-- | src/bibiman.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bibiman.rs b/src/bibiman.rs index ea9dbf5..3341653 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -29,7 +29,6 @@ use color_eyre::eyre::{Error, Result}; use editor_command::EditorBuilder; use ratatui::widgets::ScrollbarState; use regex::Regex; -use std::ffi::OsString; use std::fs::{self, read_to_string}; use std::fs::{File, OpenOptions}; use std::io::Write; @@ -680,15 +679,15 @@ impl Bibiman { // TODO: Selection for multiple files // let object = self.entry_table.entry_table_items[entry_idx].filepath()[0]; let file = expand_home(&PathBuf::from(popup_entry.clone())); - let object: OsString = popup_entry.into(); + // let object: OsString = popup_entry.into(); if file.is_file() { - app::open_connected_file(cfg, &object)?; + app::open_connected_file(cfg, &file.into_os_string())?; self.close_popup(); } else { self.open_popup( PopupKind::MessageError, Some("No valid file path: "), - Some(object.to_str().unwrap()), + Some(file.to_str().unwrap()), None, )?; } |
