From fd553227f0403d37e158d894522b978628ea3a8b Mon Sep 17 00:00:00 2001 From: Alex Soderman <5639572+asoderman@users.noreply.github.com> Date: Tue, 27 Mar 2018 10:58:26 -0400 Subject: [PATCH] remove underline from icon --- src/output/icons.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/output/icons.rs b/src/output/icons.rs index 7932e1b..6303378 100644 --- a/src/output/icons.rs +++ b/src/output/icons.rs @@ -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 {