mirror of
https://github.com/eza-community/eza.git
synced 2025-12-23 05:36:50 +00:00
feat(output): handle icon overrides in FileName.paint
This basically ports the PR #914 and thus also resolves #909 Signed-off-by: Sandro-Alessio Gierens <sandro@gierens.de>
This commit is contained in:
parent
b16d9bbdd9
commit
80aa4702ef
1 changed files with 6 additions and 2 deletions
|
|
@ -203,8 +203,12 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> {
|
|||
};
|
||||
|
||||
if let Some(spaces_count) = spaces_count_opt {
|
||||
let style = iconify_style(self.colours.icon().unwrap_or_else(|| self.style()));
|
||||
let file_icon = icon_for_file(self.file).to_string();
|
||||
let style = iconify_style(self.style());
|
||||
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)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue