diff --git a/Cargo.lock b/Cargo.lock index 5a19418..c13e944 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1002,6 +1002,7 @@ dependencies = [ [[package]] name = "ratatui" version = "0.26.3" +source = "git+https://github.com/itsjunetime/ratatui.git#0e185042b728b3bc8baff245154e6d200bb64f3b" dependencies = [ "bitflags 2.5.0", "cassowary", @@ -1020,6 +1021,7 @@ dependencies = [ [[package]] name = "ratatui-image" version = "1.0.0" +source = "git+https://github.com/itsjunetime/ratatui-image.git?branch=vb64_on_personal#5ae2012631c0ca273deeab8f6444e9c2f0edaf51" dependencies = [ "base64", "dyn-clone", @@ -1028,6 +1030,7 @@ dependencies = [ "rand", "ratatui", "rustix", + "vb64", ] [[package]] @@ -1449,6 +1452,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "vb64" +version = "0.1.2" +source = "git+https://github.com/lukaslihotzki/vb64?branch=update#01e791186f57982511a3bcfb0d2316010c1adef0" + [[package]] name = "version-compare" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 97b6981..195586f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,10 +6,10 @@ edition = "2021" [dependencies] poppler-rs = { version = "0.23.0", features = ["v21_5"] } cairo-rs = { version = "0.19.4", features = ["png"] } -# ratatui = "0.26.3" -ratatui = { path = "./ratatui" } -# ratatui-image = { version = "1.0.0", features = ["rustix"], default-features = false } -ratatui-image = { path = "./ratatui-image", features = ["rustix"], default-features = false } +ratatui = { git = "https://github.com/itsjunetime/ratatui.git" } +# ratatui = { path = "./ratatui" } +ratatui-image = { git = "https://github.com/itsjunetime/ratatui-image.git", branch = "vb64_on_personal", features = ["rustix", "vb64"], default-features = false } +# ratatui-image = { path = "./ratatui-image", features = ["rustix", "vb64"], default-features = false } crossterm = { version = "0.27.0", features = ["event-stream"] } image = { version = "0.25.1", features = ["png", "rayon"], default-features = false } notify = "6.1.1" @@ -18,3 +18,7 @@ futures-util = { version = "0.3.30", default-features = false } glib = "0.19.6" itertools = "*" oxipng = { version = "9.1.1", default-features = false, features = ["parallel"] } + +[profile.production] +inherits = "release" +lto = "fat" diff --git a/TODO.txt b/TODO.txt deleted file mode 100644 index d68634d..0000000 --- a/TODO.txt +++ /dev/null @@ -1 +0,0 @@ -- Look into more efficient 'skip'ing in ratatui so that you don't have to unicode_width::width a bunch of escape codes diff --git a/build_most_optimized.sh b/build_most_optimized.sh new file mode 100644 index 0000000..caea15f --- /dev/null +++ b/build_most_optimized.sh @@ -0,0 +1 @@ +RUSTFLAGS="-Cpanic=abort -Ccodegen-units=1 -Cembed-bitcode=yes -Zdylib-lto -Copt-level=z -Zlocation-detail=none -Cstrip=symbols -Ctarget-cpu=native" cargo -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort build --profile production --target "$(rustc +nightly -Z unstable-options --print target-spec-json | jq -r '."llvm-target"')" diff --git a/ratatui b/ratatui index fadc73d..0e18504 160000 --- a/ratatui +++ b/ratatui @@ -1 +1 @@ -Subproject commit fadc73d62ef897e5065d041dcbac37bbb8d89698 +Subproject commit 0e185042b728b3bc8baff245154e6d200bb64f3b diff --git a/ratatui-image b/ratatui-image index b779d29..5ae2012 160000 --- a/ratatui-image +++ b/ratatui-image @@ -1 +1 @@ -Subproject commit b779d29d6b40cf760ca4706ceb2bb6d75784dfa5 +Subproject commit 5ae2012631c0ca273deeab8f6444e9c2f0edaf51 diff --git a/src/tui.rs b/src/tui.rs index 2d55542..d3648f3 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -146,7 +146,7 @@ impl Tui { let (msg_str, color) = match self.bottom_msg { BottomMessage::Help => ( - "/: Search, g: Go To Page".to_string(), + "/: Search, g: Go To Page, n: Next Search Result, N: Previous Search Result".to_string(), Color::Blue ), BottomMessage::Error(ref e) => ( @@ -248,8 +248,6 @@ impl Tui { } fn render_single_page(&mut self, frame: &mut Frame<'_>, page_idx: usize, img_area: Rect) { - // TODO: Sometimes a page just won't render. But there will be space for it so we clearly - // know it should be there. Maybe we're not resetting the last render rect as we should be? match self.rendered[page_idx].img { Some(ref page_img) => frame.render_widget(Image::new(&**page_img), img_area), None => Self::render_loading_in(frame, img_area)