mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
Use new mupdf search API
This commit is contained in:
+5
-1
@@ -129,7 +129,7 @@ pub fn start_all_rendering(path: impl AsRef<Path>) -> RenderState {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn render_doc(path: impl AsRef<Path>) {
|
||||
pub async fn render_doc(path: impl AsRef<Path>, search_term: Option<&str>) {
|
||||
let RenderState {
|
||||
mut from_render_rx,
|
||||
mut from_converter_rx,
|
||||
@@ -138,6 +138,10 @@ pub async fn render_doc(path: impl AsRef<Path>) {
|
||||
to_render_tx
|
||||
} = start_all_rendering(path);
|
||||
|
||||
if let Some(term) = search_term {
|
||||
to_render_tx.send(RenderNotif::Search(term.to_owned())).unwrap();
|
||||
}
|
||||
|
||||
while pages.is_empty() || pages.iter().any(Option::is_none) {
|
||||
tokio::select! {
|
||||
Some(renderer_msg) = from_render_rx.next() => {
|
||||
|
||||
Reference in New Issue
Block a user