From 5cfcab305ef0a02771b3bd651ed343e436fc7f7e 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: Fri, 20 Dec 2024 19:49:42 +0800 Subject: [PATCH] fix: missing a hover after reordering from an external plugin (#2072) --- yazi-config/preset/yazi-default.toml | 4 +--- yazi-core/src/tab/commands/sort.rs | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/yazi-config/preset/yazi-default.toml b/yazi-config/preset/yazi-default.toml index da1f2ae10..dd0f24053 100644 --- a/yazi-config/preset/yazi-default.toml +++ b/yazi-config/preset/yazi-default.toml @@ -132,9 +132,7 @@ previewers = [ { mime = "application/pdf", run = "pdf" }, # Archive { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" }, - { mime = "application/{debian-package,redhat-package-manager,rpm}", run = "archive" }, - { mime = "application/debian.binary-package", run = "archive" }, - { mime = "application/android.package-archive", run = "archive" }, + { mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}", run = "archive" }, { name = "*.{AppImage,appimage}", run = "archive" }, # Virtual Disk / Disk Image { mime = "application/{iso9660-image,qemu-disk,ms-wim,apple-diskimage}", run = "archive" }, diff --git a/yazi-core/src/tab/commands/sort.rs b/yazi-core/src/tab/commands/sort.rs index efcd8c957..15c1aa07f 100644 --- a/yazi-core/src/tab/commands/sort.rs +++ b/yazi-core/src/tab/commands/sort.rs @@ -7,10 +7,10 @@ use yazi_shared::event::CmdCow; use crate::{tab::Tab, tasks::Tasks}; impl Tab { - pub fn sort(&mut self, mut c: CmdCow, tasks: &Tasks) { + pub fn sort(&mut self, c: CmdCow, tasks: &Tasks) { let pref = &mut self.pref; - if let Some(by) = c.take_first_str() { - pref.sort_by = SortBy::from_str(&by).unwrap_or_default(); + if let Some(by) = c.first_str() { + pref.sort_by = SortBy::from_str(by).unwrap_or_default(); } pref.sort_reverse = c.maybe_bool("reverse").unwrap_or(pref.sort_reverse); @@ -19,6 +19,8 @@ impl Tab { pref.sort_translit = c.maybe_bool("translit").unwrap_or(pref.sort_translit); self.apply_files_attrs(); + + ManagerProxy::hover(None, self.id); ManagerProxy::update_paged(); tasks.prework_sorted(&self.current.files);