mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
Make features more modular and call search more easily
This commit is contained in:
+3
-1
@@ -37,7 +37,7 @@ flume = { version = "0.11.0", default-features = false, features = ["async"] }
|
||||
xflags = "0.4.0-pre.2"
|
||||
mimalloc = "0.1.43"
|
||||
nix = { version = "0.29.0", features = ["signal"] }
|
||||
mupdf = "0.4.4"
|
||||
mupdf = { version = "0.4.4", default-features = false, features = ["svg", "system-fonts", "img"] }
|
||||
|
||||
# for tracing with tokio-console
|
||||
console-subscriber = { version = "0.4.0", optional = true }
|
||||
@@ -50,6 +50,8 @@ lto = "fat"
|
||||
default = ["nightly"]
|
||||
nightly = ["ratatui-image/vb64"]
|
||||
tracing = ["tokio/tracing", "dep:console-subscriber"]
|
||||
epub = ["mupdf/epub"]
|
||||
cbz = ["mupdf/cbz"]
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.5.1", features = ["async_tokio"] }
|
||||
|
||||
+2
-3
@@ -3,7 +3,7 @@ use std::{thread::sleep, time::Duration};
|
||||
use crossterm::terminal::WindowSize;
|
||||
use flume::{Receiver, SendError, Sender, TryRecvError};
|
||||
use itertools::Itertools;
|
||||
use mupdf::{Colorspace, Document, Matrix, Page, Pixmap, TextPageOptions};
|
||||
use mupdf::{Colorspace, Document, Matrix, Page, Pixmap};
|
||||
use ratatui::layout::Rect;
|
||||
|
||||
pub enum RenderNotif {
|
||||
@@ -336,8 +336,7 @@ fn render_single_page_to_ctx(
|
||||
let result_rects = search_term
|
||||
.as_ref()
|
||||
.map(|term| {
|
||||
page.to_text_page(TextPageOptions::all())?
|
||||
.search(term, u32::MAX)
|
||||
page.search(term, u32::MAX)
|
||||
})
|
||||
.transpose()?
|
||||
.unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user