summaryrefslogtreecommitdiffstats
path: root/src/paint.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-16 15:43:51 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-16 15:49:43 -0400
commit325e4e2cfc41dd7927ebc09867b17e0ea7737262 (patch)
treee65f13e1f50e6a30004136aa0d706bc5859708e6 /src/paint.rs
parentcbf8e0d80f180125773bfc5ed8c33d7631da9d6f (diff)
Do not paint empty strings
Diffstat (limited to 'src/paint.rs')
-rw-r--r--src/paint.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/paint.rs b/src/paint.rs
index 9ed065c4..bf836c4d 100644
--- a/src/paint.rs
+++ b/src/paint.rs
@@ -200,7 +200,9 @@ impl<'a> Painter<'a> {
}
handled_prefix = true;
}
- ansi_strings.push(section_style.ansi_term_style.paint(text));
+ if !text.is_empty() {
+ ansi_strings.push(section_style.ansi_term_style.paint(text));
+ }
}
// Set style for the right-fill.
let mut have_background_for_right_fill = false;