mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-02 08:01:47 -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"
|
xflags = "0.4.0-pre.2"
|
||||||
mimalloc = "0.1.43"
|
mimalloc = "0.1.43"
|
||||||
nix = { version = "0.29.0", features = ["signal"] }
|
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
|
# for tracing with tokio-console
|
||||||
console-subscriber = { version = "0.4.0", optional = true }
|
console-subscriber = { version = "0.4.0", optional = true }
|
||||||
@@ -50,6 +50,8 @@ lto = "fat"
|
|||||||
default = ["nightly"]
|
default = ["nightly"]
|
||||||
nightly = ["ratatui-image/vb64"]
|
nightly = ["ratatui-image/vb64"]
|
||||||
tracing = ["tokio/tracing", "dep:console-subscriber"]
|
tracing = ["tokio/tracing", "dep:console-subscriber"]
|
||||||
|
epub = ["mupdf/epub"]
|
||||||
|
cbz = ["mupdf/cbz"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = { version = "0.5.1", features = ["async_tokio"] }
|
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 crossterm::terminal::WindowSize;
|
||||||
use flume::{Receiver, SendError, Sender, TryRecvError};
|
use flume::{Receiver, SendError, Sender, TryRecvError};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use mupdf::{Colorspace, Document, Matrix, Page, Pixmap, TextPageOptions};
|
use mupdf::{Colorspace, Document, Matrix, Page, Pixmap};
|
||||||
use ratatui::layout::Rect;
|
use ratatui::layout::Rect;
|
||||||
|
|
||||||
pub enum RenderNotif {
|
pub enum RenderNotif {
|
||||||
@@ -336,8 +336,7 @@ fn render_single_page_to_ctx(
|
|||||||
let result_rects = search_term
|
let result_rects = search_term
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|term| {
|
.map(|term| {
|
||||||
page.to_text_page(TextPageOptions::all())?
|
page.search(term, u32::MAX)
|
||||||
.search(term, u32::MAX)
|
|
||||||
})
|
})
|
||||||
.transpose()?
|
.transpose()?
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|||||||
Reference in New Issue
Block a user