mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
0967a701f9
commit
d7e2e1bc93
2 changed files with 11 additions and 7 deletions
|
|
@ -88,7 +88,7 @@ impl<'a> Widget for Folder<'a> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut path = format!(" {icon} {}", readable_path(f.path(), &self.folder.cwd));
|
let mut path = format!(" {icon} {}", readable_path(f.path(), &self.folder.cwd));
|
||||||
if let Some(ref link_to) = f.link_to {
|
if let Some(link_to) = f.link_to() {
|
||||||
if MANAGER.show_symlink {
|
if MANAGER.show_symlink {
|
||||||
path.push_str(&format!(" -> {}", link_to.display()));
|
path.push_str(&format!(" -> {}", link_to.display()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@ use tokio::fs;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct File {
|
pub struct File {
|
||||||
pub(super) path: PathBuf,
|
pub(super) path: PathBuf,
|
||||||
pub(super) meta: Metadata,
|
pub(super) meta: Metadata,
|
||||||
pub(super) length: Option<u64>,
|
pub(super) length: Option<u64>,
|
||||||
pub link_to: Option<PathBuf>,
|
pub(super) link_to: Option<PathBuf>,
|
||||||
pub is_link: bool,
|
pub(super) is_link: bool,
|
||||||
pub is_hidden: bool,
|
pub(super) is_hidden: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl File {
|
impl File {
|
||||||
|
|
@ -59,4 +59,8 @@ impl File {
|
||||||
// --- Length
|
// --- Length
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn length(&self) -> Option<u64> { self.length }
|
pub fn length(&self) -> Option<u64> { self.length }
|
||||||
|
|
||||||
|
// --- Link to
|
||||||
|
#[inline]
|
||||||
|
pub fn link_to(&self) -> Option<&PathBuf> { self.link_to.as_ref() }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue