From 9bd0912d93b2d6aa9d9b2f83012513d7dc96568d Mon Sep 17 00:00:00 2001 From: MartinFillon Date: Thu, 18 Apr 2024 09:15:50 +0200 Subject: [PATCH] fix: checking for deref flag in file_name As per Vosjedev mentionned on #932 dereference (`-X`) was ignored on latest eza version however it was used for file-names. This was due to the usage of the function `with_link_paths` that forced a link printing, whereas the deref flag prevent it. This also adds some debug printing. --- src/fs/file.rs | 2 ++ src/output/details.rs | 2 ++ src/output/file_name.rs | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fs/file.rs b/src/fs/file.rs index ca0be62b5..ba2703d91 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -135,6 +135,8 @@ impl<'dir> File<'dir> { RecursiveSize::None }; + debug!("deref_links {}", deref_links); + let mut file = File { name, ext, diff --git a/src/output/details.rs b/src/output/details.rs index f7e0bc0e0..2ff581141 100644 --- a/src/output/details.rs +++ b/src/output/details.rs @@ -328,6 +328,8 @@ impl<'a> Render<'a> { .paint() .promote(); + debug!("file_name {:?}", file_name); + let row = Row { tree: tree_params, cells: egg.table_row, diff --git a/src/output/file_name.rs b/src/output/file_name.rs index 30c88a93c..313f26455 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -162,7 +162,9 @@ impl<'a, 'dir, C> FileName<'a, 'dir, C> { /// Sets the flag on this file name to display link targets with an /// arrow followed by their path. pub fn with_link_paths(mut self) -> Self { - self.link_style = LinkStyle::FullLinkPaths; + if !self.file.deref_links { + self.link_style = LinkStyle::FullLinkPaths; + } self }