Skip to content

Commit

Permalink
fix: wait till mimetype is resolved to avoid flickering (#1542)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi authored Aug 23, 2024
1 parent 91da9d1 commit 0601079
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion yazi-boot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ serde = { workspace = true }

[build-dependencies]
clap = { workspace = true }
clap_complete = "4.5.19"
clap_complete = "4.5.23"
clap_complete_fig = "4.5.2"
clap_complete_nushell = "4.5.3"
vergen-gitcl = { version = "1.0.0", features = [ "build" ] }
2 changes: 1 addition & 1 deletion yazi-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ yazi-shared = { path = "../yazi-shared", version = "0.3.1" }
# External build dependencies
anyhow = { workspace = true }
clap = { workspace = true }
clap_complete = "4.5.19"
clap_complete = "4.5.23"
clap_complete_fig = "4.5.2"
clap_complete_nushell = "4.5.3"
serde_json = { workspace = true }
Expand Down
5 changes: 4 additions & 1 deletion yazi-core/src/manager/commands/peek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ impl Manager {
}

let mime = self.mimetype.get(&hovered.url).cloned().unwrap_or_default();
self.active_mut().preview.go(hovered, &mime, opt.force);
if !mime.is_empty() {
// Wait till mimetype is resolved to avoid flickering
self.active_mut().preview.go(hovered, &mime, opt.force);
}
}
}

0 comments on commit 0601079

Please sign in to comment.