diff options
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -18,6 +18,7 @@ use crate::bibiman::CurrentArea; use crate::config::BibiConfig; use color_eyre::eyre::{Context, Ok, Result}; +use editor_command::EditorBuilder; // use super::Event; use crate::cliargs::CLIArgs; use crate::tui::commands::InputCmdAction; @@ -279,7 +280,7 @@ impl App { if let Some(PopupKind::Help) = self.bibiman.popup_area.popup_kind { self.bibiman.close_popup(); } else if let Some(PopupKind::OpenRes) = self.bibiman.popup_area.popup_kind { - self.bibiman.open_connected_res(cfg)?; + self.bibiman.open_connected_res(cfg, tui)?; } else if let Some(PopupKind::AppendToFile) = self.bibiman.popup_area.popup_kind { self.bibiman.append_entry_to_file(cfg)? @@ -423,19 +424,6 @@ pub fn open_connected_file(cfg: &BibiConfig, file: &OsStr) -> Result<()> { Ok(()) } -pub fn open_connected_note(cfg: &BibiConfig, file: &OsStr) -> Result<()> { - // let cmd = cfg.general.editor.as_ref().unwrap(); - - let _ = Command::new("xdg-open") - .arg(file) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .spawn() - .wrap_err("Opening file not possible"); - - Ok(()) -} - pub fn open_connected_link(cfg: &BibiConfig, link: &str) -> Result<()> { // Build command to execute pdf-reader. 'xdg-open' is Linux standard let cmd = &cfg.general.url_opener; |
