Skip to content

Commit

Permalink
fix name render
Browse files Browse the repository at this point in the history
  • Loading branch information
0jdxt committed Mar 28, 2021
1 parent 2126841 commit 1f06f8f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 11 additions & 6 deletions src/display.rs
Expand Up @@ -273,7 +273,13 @@ fn get_output<'a>(
Block::Date => block_vec.push(meta.date.render(colors, &flags)),
Block::Name => {
block_vec.extend(vec![
meta.name.render(colors, icons, &display_option),
meta.name.render(
colors,
icons,
&display_option,
&meta.metadata,
&flags.icons.separator.0,
),
meta.indicator.render(&flags),
]);
if !(flags.no_symlink.0 || flags.dereference.0 || flags.layout == Layout::Grid) {
Expand Down Expand Up @@ -374,7 +380,6 @@ mod tests {
.zip(&[22, 11, 15, 10, 6, 26, 4, 2])
};
}
>>>>>>> 0f3eb3e (general speed up)

#[test]
fn test_display_get_visible_width_without_icons() {
Expand Down Expand Up @@ -512,7 +517,7 @@ mod tests {
&metas,
&flags,
&Colors::new(color::Theme::NoColor),
&Icons::new(icon::Theme::NoIcon, " ".to_string()),
&Icons::new(icon::Theme::NoIcon),
);

assert_eq!("one.d\n├── .hidden\n└── two\n", output);
Expand Down Expand Up @@ -542,7 +547,7 @@ mod tests {
&metas,
&flags,
&Colors::new(color::Theme::NoColor),
&Icons::new(icon::Theme::NoIcon, " ".to_string()),
&Icons::new(icon::Theme::NoIcon),
);

let length_before_b = |i| -> usize {
Expand Down Expand Up @@ -581,7 +586,7 @@ mod tests {
&metas,
&flags,
&Colors::new(color::Theme::NoColor),
&Icons::new(icon::Theme::NoIcon, " ".to_string()),
&Icons::new(icon::Theme::NoIcon),
);

assert_eq!(output.lines().nth(1).unwrap().chars().nth(0).unwrap(), '└');
Expand Down Expand Up @@ -619,7 +624,7 @@ mod tests {
&metas,
&flags,
&Colors::new(color::Theme::NoColor),
&Icons::new(icon::Theme::NoIcon, " ".to_string()),
&Icons::new(icon::Theme::NoIcon),
);

assert!(output.ends_with("└── two\n"));
Expand Down
4 changes: 0 additions & 4 deletions src/meta/mod.rs
Expand Up @@ -243,8 +243,4 @@ impl Meta {
content: None,
})
}

pub fn get_symlink(&self) -> &SymLink {
&self.symlink
}
}

0 comments on commit 1f06f8f

Please sign in to comment.