From cbf8d16ed88bdfb5f9699076a6f2a689984ad4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Fri, 16 Nov 2012 12:49:54 +0100 Subject: [PATCH] Ignore empty segments that aren't filler segments --- lib/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core.py b/lib/core.py index a4f353da..26950054 100644 --- a/lib/core.py +++ b/lib/core.py @@ -15,8 +15,11 @@ class Powerline: def __init__(self, segments): '''Create a new Powerline. + + Segments that have empty contents and aren't filler segments are + dropped from the segment array. ''' - self.segments = segments + self.segments = [segment for segment in segments if segment.contents or segment.filler] def render(self, renderer, width=None): '''Render all the segments with the specified renderer.