aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukeflo2025-07-08 21:11:52 +0200
committerlukeflo2025-07-08 21:11:52 +0200
commit0a1a6ab89259543e3d68d2e537c74ecf5d8656fe (patch)
tree7b1caf0d5260968df1aea10db5fd2a43d712eff5
parent6ef7ca5bcfd4489d400481ad2a32fcbc85dee3aa (diff)
downloadbibiman-0a1a6ab89259543e3d68d2e537c74ecf5d8656fe.tar.gz
bibiman-0a1a6ab89259543e3d68d2e537c74ecf5d8656fe.zip
fix some tests, default config, help popup
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/bibiman/entries.rs29
-rw-r--r--src/bibiman/search.rs1
-rw-r--r--src/config.rs10
-rw-r--r--src/tui/popup.rs4
6 files changed, 39 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fa61b38..239ab3c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -91,7 +91,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bibiman"
-version = "0.13.0"
+version = "0.13.1"
dependencies = [
"arboard",
"biblatex",
diff --git a/Cargo.toml b/Cargo.toml
index 974a5f9..d67943a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bibiman"
-version = "0.13.0"
+version = "0.13.1"
authors = ["lukeflo <lukeflo_git@posteo.de>"]
license = "GPL-3.0-or-later"
repository = "https://codeberg.org/lukeflo/bibiman"
diff --git a/src/bibiman/entries.rs b/src/bibiman/entries.rs
index 9b536fd..8f678bc 100644
--- a/src/bibiman/entries.rs
+++ b/src/bibiman/entries.rs
@@ -131,7 +131,11 @@ impl EntryTable {
#[cfg(test)]
mod tests {
- use crate::bibiman::BibiData;
+ use crate::{
+ bibiman::{bibisetup::BibiRow, BibiData},
+ cliargs::CLIArgs,
+ config::BibiConfig,
+ };
#[test]
fn check_os() {
@@ -146,6 +150,7 @@ mod tests {
#[test]
fn shorten_authors() {
+ let cfg = BibiConfig::new(&CLIArgs::default());
let mut entry: BibiData = BibiData {
id: 1,
authors: "Miller, Schmitz, Bernard".to_string(),
@@ -161,9 +166,10 @@ mod tests {
file_field: false,
subtitle: None,
notes: None,
+ symbols: [None, None, None],
};
- let entry_vec = BibiData::ref_vec(&mut entry);
+ let entry_vec = BibiData::ref_vec(&mut entry, &cfg);
let mut entry_editors: BibiData = BibiData {
id: 2,
@@ -180,17 +186,30 @@ mod tests {
file_field: false,
subtitle: None,
notes: None,
+ symbols: [None, None, None],
};
- let entry_vec_editors = BibiData::ref_vec(&mut entry_editors);
+ let entry_vec_editors = BibiData::ref_vec(&mut entry_editors, &cfg);
assert_eq!(
entry_vec,
- vec!["Miller et al.", "A title", "2000", "article"]
+ BibiRow {
+ authors: "Miller et al.",
+ title: "A title",
+ year: "2000",
+ pubtype: "article",
+ symbols: &[None, None, None]
+ }
);
assert_eq!(
entry_vec_editors,
- vec!["Miller et al. (ed.)", "A title", "2000", "article"]
+ BibiRow {
+ authors: "Miller et al. (ed.)",
+ title: "A title",
+ year: "2000",
+ pubtype: "article",
+ symbols: &[None, None, None]
+ }
)
}
}
diff --git a/src/bibiman/search.rs b/src/bibiman/search.rs
index 0e32f63..f6679a4 100644
--- a/src/bibiman/search.rs
+++ b/src/bibiman/search.rs
@@ -138,6 +138,7 @@ mod tests {
file_field: true,
subtitle: None,
notes: None,
+ symbols: [None, None, None],
};
let joined_vec = BibiSearch::convert_to_string(&bibvec);
diff --git a/src/config.rs b/src/config.rs
index 1f6c619..4e46fdd 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -351,6 +351,9 @@ mod tests {
[general]
pdf_opener = "xdg-open"
url_opener = "xdg-open"
+ note_symbol = "N"
+ file_symbol = "F"
+ link_symbol = "L"
[colors]
main_text_color = "250"
@@ -361,8 +364,15 @@ mod tests {
confirm_color = "47"
warn_color = "124"
bar_bg_color = "235"
+ popup_fg_color = "43"
popup_bg_color = "234"
selected_row_bg_color = "237"
+ note_color = "123"
+ file_color = "209"
+ link_color = "39"
+ author_color = "38"
+ title_color = "37"
+ year_color = "135"
"#,
)?;
diff --git a/src/tui/popup.rs b/src/tui/popup.rs
index 46e4792..4dbf6b6 100644
--- a/src/tui/popup.rs
+++ b/src/tui/popup.rs
@@ -87,8 +87,8 @@ impl PopupArea {
),
("y: ", "yank/copy citekey of selected entry to clipboard"),
("e: ", "Open editor at selected entry"),
- ("o: ", "Open with selected entry associated PDF"),
- ("u: ", "Open DOI/URL of selected entry"),
+ ("o: ", "Open resource attached to selected entry"),
+ ("n: ", "Create note for selected entry"),
("a: ", "Add new entry"),
("ESC: ", "Reset all lists"),
("Keyword List", "sub"),