mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
b8cc2dcae8
commit
5e8b0ac1e9
4 changed files with 8 additions and 5 deletions
|
|
@ -113,7 +113,7 @@ previewers = [
|
|||
{ mime = "application/pdf", run = "pdf" },
|
||||
# Archive
|
||||
{ mime = "application/{,g}zip", run = "archive" },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", run = "archive" },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" },
|
||||
# Font
|
||||
{ mime = "font/*", run = "font" },
|
||||
{ mime = "application/vnd.ms-opentype", run = "font" },
|
||||
|
|
|
|||
|
|
@ -27,10 +27,13 @@ impl Manager {
|
|||
if !self.active_mut().try_escape_visual() {
|
||||
return;
|
||||
}
|
||||
let Some(hovered) = self.hovered().map(|h| &h.url) else {
|
||||
return;
|
||||
};
|
||||
|
||||
let mut opt = opt.into() as Opt;
|
||||
opt.targets = if opt.hovered {
|
||||
self.hovered().map(|h| vec![h.clone().url]).unwrap_or_default()
|
||||
vec![hovered.clone()]
|
||||
} else {
|
||||
self.selected_or_hovered(false).cloned().collect()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ use yazi_shared::{event::Cmd, fs::{maybe_exists, ok_or_not_found, paths_to_same_
|
|||
use crate::manager::Manager;
|
||||
|
||||
pub struct Opt {
|
||||
force: bool,
|
||||
hovered: bool,
|
||||
force: bool,
|
||||
empty: String,
|
||||
cursor: String,
|
||||
}
|
||||
|
|
@ -19,8 +19,8 @@ pub struct Opt {
|
|||
impl From<Cmd> for Opt {
|
||||
fn from(mut c: Cmd) -> Self {
|
||||
Self {
|
||||
force: c.bool("force"),
|
||||
hovered: c.bool("hovered"),
|
||||
force: c.bool("force"),
|
||||
empty: c.take_str("empty").unwrap_or_default(),
|
||||
cursor: c.take_str("cursor").unwrap_or_default(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function M:peek()
|
|||
if size > 0 then
|
||||
sizes[#sizes + 1] = ui.Line(string.format(" %s ", ya.readable_size(size)))
|
||||
else
|
||||
sizes[#sizes + 1] = ui.Line(" - ")
|
||||
sizes[#sizes + 1] = ui.Line("")
|
||||
end
|
||||
|
||||
::continue::
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue