mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-12-30 19:39:09 +00:00
remove underline from icon
This commit is contained in:
parent
217d1eefa9
commit
fd553227f0
@ -1,3 +1,4 @@
|
||||
use ansi_term::Style;
|
||||
use fs::File;
|
||||
use output::file_name::FileStyle;
|
||||
|
||||
@ -5,9 +6,18 @@ pub fn painted_icon(file: &File, style: &FileStyle) -> String {
|
||||
let file_icon = icon(&file).to_string();
|
||||
let painted = style.exts
|
||||
.colour_file(&file)
|
||||
.map_or(file_icon.to_string(), |c| { c.paint(file_icon).to_string() });
|
||||
.map_or(file_icon.to_string(), |c| {
|
||||
// Remove underline from icon
|
||||
if c.is_underline {
|
||||
match c.foreground {
|
||||
Some(color) => Style::from(color).paint(file_icon).to_string(),
|
||||
None => Style::default().paint(file_icon).to_string(),
|
||||
}
|
||||
} else {
|
||||
c.paint(file_icon).to_string()
|
||||
}
|
||||
});
|
||||
format!("{} ", painted)
|
||||
|
||||
}
|
||||
|
||||
fn icon(file: &File) -> char {
|
||||
|
Loading…
Reference in New Issue
Block a user