mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-02 08:01:47 -04:00
Add debug logging and fix cursor placement after image display
This commit is contained in:
Generated
+3
-2
@@ -997,9 +997,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flexi_logger"
|
||||
version = "0.31.0"
|
||||
version = "0.31.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab9765cc4ba26211f932a7a37649ec88752f7abcbd8822617572562ce31234df"
|
||||
checksum = "759bfa52db036a2db54f0b5f0ff164efa249b3014720459c5ea4198380c529bc"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"log",
|
||||
@@ -1591,6 +1591,7 @@ dependencies = [
|
||||
"crossterm",
|
||||
"futures-core",
|
||||
"image",
|
||||
"log",
|
||||
"memchr",
|
||||
"memmap2",
|
||||
"psx-shm",
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ mimalloc = "0.1.43"
|
||||
nix = { version = "0.30.0", features = ["signal"] }
|
||||
mupdf = { version = "0.5.0", default-features = false, features = ["svg", "system-fonts", "img"] }
|
||||
rayon = { version = "*", default-features = false }
|
||||
# kittage = { path = "../kittage/", features = ["crossterm-tokio", "image-crate"] }
|
||||
kittage = { git = "https://github.com/itsjunetime/kittage.git", features = ["crossterm-tokio", "image-crate"] }
|
||||
# kittage = { path = "../kittage/", features = ["crossterm-tokio", "image-crate", "log"] }
|
||||
kittage = { git = "https://github.com/itsjunetime/kittage.git", features = ["crossterm-tokio", "image-crate", "log"] }
|
||||
memmap2 = "*"
|
||||
|
||||
# logging
|
||||
|
||||
@@ -20,6 +20,7 @@ use crate::{
|
||||
skip::InterleavedAroundWithMax
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum MaybeTransferred {
|
||||
NotYet(kittage::image::Image<'static>),
|
||||
Transferred(kittage::ImageId)
|
||||
|
||||
+7
-1
@@ -11,7 +11,7 @@ use kittage::{
|
||||
AsyncInputReader, ImageDimensions, ImageId, NumberOrId, PixelFormat,
|
||||
action::Action,
|
||||
delete::{ClearOrDelete, DeleteConfig, WhichToDelete},
|
||||
display::{DisplayConfig, DisplayLocation},
|
||||
display::{CursorMovementPolicy, DisplayConfig, DisplayLocation},
|
||||
error::TransmitError,
|
||||
image::Image,
|
||||
medium::Medium
|
||||
@@ -137,11 +137,15 @@ pub async fn display_kitty_images<'es>(
|
||||
{
|
||||
let config = DisplayConfig {
|
||||
location: display_loc,
|
||||
cursor_movement: CursorMovementPolicy::DontMove,
|
||||
..DisplayConfig::default()
|
||||
};
|
||||
|
||||
execute!(std::io::stdout(), MoveTo(pos.x, pos.y)).unwrap();
|
||||
|
||||
log::debug!("going to display img {img:#?}");
|
||||
log::debug!("displaying with config {config:#?}");
|
||||
|
||||
let this_err = match img {
|
||||
MaybeTransferred::NotYet(image) => {
|
||||
let mut fake_image = Image {
|
||||
@@ -191,6 +195,8 @@ pub async fn display_kitty_images<'es>(
|
||||
.map_err(|e| (page_num, e))
|
||||
};
|
||||
|
||||
log::debug!("this_err is {this_err:#?}");
|
||||
|
||||
if let Err((id, e)) = this_err {
|
||||
let e = err.get_or_insert_with(|| (vec![], e));
|
||||
e.0.push(id);
|
||||
|
||||
Reference in New Issue
Block a user