Skip to content

Commit

Permalink
feat(output): handle icon overrides in FileName.paint
Browse files Browse the repository at this point in the history
This basically ports the PR eza-community#914 and thus also resolves eza-community#909

Signed-off-by: Sandro-Alessio Gierens <[email protected]>
  • Loading branch information
gierens committed Mar 31, 2024
1 parent 0689296 commit d1c412a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/output/file_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> {

if let Some(spaces_count) = spaces_count_opt {
let style = iconify_style(self.style());
let file_icon = icon_for_file(self.file).to_string();
let file_icon = match self.colours.icon_override(self.file) {
Some(icon) => icon,
None => icon_for_file(self.file),
}
.to_string();
bits.push(style.paint(file_icon));
bits.push(style.paint(" ".repeat(spaces_count as usize)));
}
Expand Down

0 comments on commit d1c412a

Please sign in to comment.