mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-01-02 20:50:15 +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 fs::File;
|
||||||
use output::file_name::FileStyle;
|
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 file_icon = icon(&file).to_string();
|
||||||
let painted = style.exts
|
let painted = style.exts
|
||||||
.colour_file(&file)
|
.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)
|
format!("{} ", painted)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn icon(file: &File) -> char {
|
fn icon(file: &File) -> char {
|
||||||
|
Loading…
Reference in New Issue
Block a user