Include the citation key in search
Would be great to include the citation key in the search. Since when we are writing in Latex, this is what we mainly memorize to identify the articles. What do you think about this?
I tried to create a PR, but I didn't manage to modify the code. I never code in Rust before.
I had thought that simply modifying this :
let search_expression = gtk::ClosureExpression::new::<String, &[gtk::Expression], _>(
&[],
glib::closure!(|entry: cratebibtex::Entry| {
let author = entry.find_tag("author").unwrap_or_default();
let title = entry.find_tag("title").unwrap_or_default();
let year = entry.find_tag("year").unwrap_or_default();
let citation_key = entry.find_tag("citation_key").unwrap_or_default();
format!("{author} {title} {year} {citation_key}")
}),
);
in src/entry_list.rs
(line 104)
and adding this :
self.bindings
.bind("citation_key", &*self.citation_key_entry, "text")
.flags(glib::BindingFlags::SYNC_CREATE | glib::BindingFlags::BIDIRECTIONAL)
.build();
in src/entry_page.rs
(after line 265)
would work, but it is apparently not that simple
I will be happy to fix the code with your help. But if you want to integrate it yourself, that's fine too.
Edited by EmixamPP