diff options
| author | lukeflo | 2025-10-19 20:16:47 +0200 |
|---|---|---|
| committer | lukeflo | 2025-10-19 20:16:47 +0200 |
| commit | bed73446ab83b69b1eb7d73f0219beb91f12e237 (patch) | |
| tree | 193b0f8d0aa1e1f3a09b7d09b7dcda71270b898a /src/bibiman.rs | |
| parent | 84294cae201b8152efba7e7c1ff661f2f6dade33 (diff) | |
| download | bibiman-bed73446ab83b69b1eb7d73f0219beb91f12e237.tar.gz bibiman-bed73446ab83b69b1eb7d73f0219beb91f12e237.zip | |
update all deps to latest version
Diffstat (limited to 'src/bibiman.rs')
| -rw-r--r-- | src/bibiman.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/bibiman.rs b/src/bibiman.rs index 392ae95..41f549a 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -511,13 +511,13 @@ impl Bibiman { tui.exit()?; // Use VISUAL or EDITOR. Set "vi" as last fallback let mut cmd: Command = EditorBuilder::new() - .source(cfg.general.editor.as_ref()) + .string(cfg.general.editor.as_ref()) .environment() - .source(Some("vi")) - .build() - .unwrap(); + .string(Some("vi")) + .build()? + .open_at(filepath, line_count as u32, 0); // Prepare arguments to open file at specific line - let status = cmd.arg(format!("+{}", line_count)).arg(filepath).status()?; + let status = cmd.status()?; if !status.success() { eprintln!("Spawning editor failed with status {}", status); } @@ -577,13 +577,13 @@ impl Bibiman { tui.exit()?; // Use VISUAL or EDITOR. Set "vi" as last fallback let mut note_cmd: Command = EditorBuilder::new() - .source(cfg.general.editor.clone()) + .string(cfg.general.editor.clone()) .environment() - .source(Some("vi")) - .build() - .unwrap(); + .string(Some("vi")) + .build()? + .open(file); // Prepare arguments to open file at specific line - let status = note_cmd.arg(file).status()?; + let status = note_cmd.status()?; if !status.success() { eprintln!("Spawning editor failed with status {}", status); } @@ -625,13 +625,14 @@ impl Bibiman { // Send GET request to doi resolver let doi_entry = ureq::get(&doi_string) - .set("Accept", "application/x-bibtex") + .header("Accept", "application/x-bibtex") .call(); if let Ok(entry) = doi_entry { // Save generated bibtex entry in structs field let entry = entry - .into_string() + .into_body() + .read_to_string() .expect("Couldn't parse fetched entry into string"); self.popup_area.popup_sel_item = entry; self.popup_area.popup_kind = Some(PopupKind::AppendToFile); |
