From a68e151194e2613df339f6b236179a6b13a97f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Mon, 20 May 2024 21:04:20 +0800 Subject: [PATCH] fix: ePUB file mime-type matching for the opener rule (#1063) --- Cargo.lock | 29 ++++++++++++++++------------- yazi-adaptor/Cargo.toml | 2 +- yazi-config/Cargo.toml | 2 +- yazi-config/preset/theme.toml | 2 +- yazi-config/preset/yazi.toml | 6 ++---- yazi-core/Cargo.toml | 2 +- yazi-fm/Cargo.toml | 2 +- yazi-plugin/Cargo.toml | 4 ++-- yazi-shared/Cargo.toml | 2 +- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6521c07..87ea2830 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -984,12 +984,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "indoc" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" - [[package]] name = "inotify" version = "0.9.6" @@ -1554,21 +1548,21 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcb12f8fbf6c62614b0d56eb352af54f6a22410c3b079eb53ee93c7b97dd31d8" +checksum = "f44c9e68fd46eda15c646fbb85e1040b657a58cdc8c98db1d97a55930d991eef" dependencies = [ "bitflags 2.5.0", "cassowary", "compact_str", "crossterm", - "indoc", "itertools", "lru", "paste", "stability", "strum", "unicode-segmentation", + "unicode-truncate", "unicode-width", ] @@ -1857,12 +1851,12 @@ dependencies = [ [[package]] name = "stability" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] @@ -1912,7 +1906,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote", "unicode-ident", ] @@ -2264,6 +2257,16 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "unicode-truncate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5fbabedabe362c618c714dbefda9927b5afc8e2a8102f47f081089a9019226" +dependencies = [ + "itertools", + "unicode-width", +] + [[package]] name = "unicode-width" version = "0.1.12" diff --git a/yazi-adaptor/Cargo.toml b/yazi-adaptor/Cargo.toml index 1aa1ad56..21e584d7 100644 --- a/yazi-adaptor/Cargo.toml +++ b/yazi-adaptor/Cargo.toml @@ -22,7 +22,7 @@ futures = "0.3.30" image = "0.24.9" imagesize = "0.12.0" kamadak-exif = "0.5.5" -ratatui = "=0.26.1" +ratatui = "0.26.3" scopeguard = "1.2.0" tokio = { version = "1.37.0", features = [ "full" ] } diff --git a/yazi-config/Cargo.toml b/yazi-config/Cargo.toml index 53cc643d..e6c6348f 100644 --- a/yazi-config/Cargo.toml +++ b/yazi-config/Cargo.toml @@ -17,7 +17,7 @@ arc-swap = "1.7.1" crossterm = "0.27.0" globset = "0.4.14" indexmap = "2.2.6" -ratatui = "=0.26.1" +ratatui = "0.26.3" serde = { version = "1.0.202", features = [ "derive" ] } shell-words = "1.1.0" toml = { version = "0.8.13", features = [ "preserve_order" ] } diff --git a/yazi-config/preset/theme.toml b/yazi-config/preset/theme.toml index c8d48043..bea3e487 100644 --- a/yazi-config/preset/theme.toml +++ b/yazi-config/preset/theme.toml @@ -176,7 +176,7 @@ rules = [ { mime = "{audio,video}/*", fg = "magenta" }, # Archives - { mime = "application/*zip", fg = "red" }, + { mime = "application/?(g)zip", fg = "red" }, { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "red" }, # Documents diff --git a/yazi-config/preset/yazi.toml b/yazi-config/preset/yazi.toml index f4b931b7..3fe36b9f 100644 --- a/yazi-config/preset/yazi.toml +++ b/yazi-config/preset/yazi.toml @@ -60,7 +60,7 @@ rules = [ { mime = "{audio,video}/*", use = [ "play", "reveal" ] }, { mime = "inode/x-empty", use = [ "edit", "reveal" ] }, - { mime = "application/*zip", use = [ "extract", "reveal" ] }, + { mime = "application/?(g)zip", use = [ "extract", "reveal" ] }, { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ "extract", "reveal" ] }, { mime = "application/json", use = [ "edit", "reveal" ] }, @@ -114,7 +114,7 @@ previewers = [ # PDF { mime = "application/pdf", run = "pdf" }, # Archive - { mime = "application/*zip", run = "archive" }, + { mime = "application/?(g)zip", run = "archive" }, { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", run = "archive" }, # Font { mime = "font/*", run = "font" }, @@ -191,5 +191,3 @@ sort_reverse = false [log] enabled = false - -[headsup] diff --git a/yazi-core/Cargo.toml b/yazi-core/Cargo.toml index ac5cd106..5bdf8f92 100644 --- a/yazi-core/Cargo.toml +++ b/yazi-core/Cargo.toml @@ -25,7 +25,7 @@ crossterm = "0.27.0" futures = "0.3.30" notify = { version = "6.1.1", default-features = false, features = [ "macos_fsevent" ] } parking_lot = "0.12.2" -ratatui = "=0.26.1" +ratatui = "0.26.3" regex = "1.10.4" scopeguard = "1.2.0" serde = "1.0.202" diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 89c93979..955128bb 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -29,7 +29,7 @@ crossterm = { version = "0.27.0", features = [ "event-stream" ] } fdlimit = "0.3.0" futures = "0.3.30" mlua = { version = "0.9.8", features = [ "lua54" ] } -ratatui = "=0.26.1" +ratatui = "0.26.3" scopeguard = "1.2.0" syntect = { version = "5.2.0", default-features = false, features = [ "parsing", "plist-load", "regex-onig" ] } tokio = { version = "1.37.0", features = [ "full" ] } diff --git a/yazi-plugin/Cargo.toml b/yazi-plugin/Cargo.toml index dba5f3d5..9d130034 100644 --- a/yazi-plugin/Cargo.toml +++ b/yazi-plugin/Cargo.toml @@ -29,14 +29,14 @@ futures = "0.3.30" md-5 = "0.10.6" mlua = { version = "0.9.8", features = [ "lua54", "serialize", "macros", "async" ] } parking_lot = "0.12.2" -ratatui = "=0.26.1" +ratatui = "0.26.3" serde = "1.0.202" serde_json = "1.0.117" shell-escape = "0.1.5" shell-words = "1.1.0" syntect = { version = "5.2.0", default-features = false, features = [ "parsing", "plist-load", "regex-onig" ] } tokio = { version = "1.37.0", features = [ "full" ] } -tokio-stream = "0.1.15" +tokio-stream = "0.1.15" tokio-util = "0.7.11" unicode-width = "0.1.12" yazi-prebuild = "0.1.2" diff --git a/yazi-shared/Cargo.toml b/yazi-shared/Cargo.toml index e8029ddf..d4ca6225 100644 --- a/yazi-shared/Cargo.toml +++ b/yazi-shared/Cargo.toml @@ -18,7 +18,7 @@ filetime = "0.2.23" futures = "0.3.30" parking_lot = "0.12.2" percent-encoding = "2.3.1" -ratatui = "=0.26.1" +ratatui = "0.26.3" regex = "1.10.4" serde = { version = "1.0.202", features = [ "derive" ] } shell-words = "1.1.0"