Skip to content

Commit

Permalink
fix: checking for deref flag in file_name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MartinFillon committed Apr 20, 2024
1 parent 87b3678 commit 9bd0912
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ impl<'dir> File<'dir> {
RecursiveSize::None
};

debug!("deref_links {}", deref_links);

let mut file = File {
name,
ext,
Expand Down
2 changes: 2 additions & 0 deletions src/output/details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion src/output/file_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 9bd0912

Please sign in to comment.