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.
This commit is contained in:
MartinFillon 2024-04-18 09:15:50 +02:00 committed by MartinFillon
parent a4782d1ddd
commit 8afb5cc285
3 changed files with 7 additions and 1 deletions

View file

@ -135,6 +135,8 @@ impl<'dir> File<'dir> {
RecursiveSize::None
};
debug!("deref_links {}", deref_links);
let mut file = File {
name,
ext,

View file

@ -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,

View file

@ -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
}