Bläddra i källkod

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.
MartinFillon 1 år sedan
förälder
incheckning
8afb5cc285
3 ändrade filer med 7 tillägg och 1 borttagningar
  1. 2 0
      src/fs/file.rs
  2. 2 0
      src/output/details.rs
  3. 3 1
      src/output/file_name.rs

+ 2 - 0
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,

+ 2 - 0
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,

+ 3 - 1
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
     }