From 325e4e2cfc41dd7927ebc09867b17e0ea7737262 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 16 Jun 2020 15:43:51 -0400 Subject: Do not paint empty strings --- src/paint.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/paint.rs') 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; -- cgit v1.2.3