From 50cb4629974c582eb6254c66dc7147d5bd53c669 Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Wed, 11 Jan 2012 15:34:56 +0000 Subject: fix ui.build_statusbar if current_buffer is None just display "[no buffers]" instead of buffer info in that case --- alot/ui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'alot/ui.py') diff --git a/alot/ui.py b/alot/ui.py index ad7abe6a..21899dc9 100644 --- a/alot/ui.py +++ b/alot/ui.py @@ -408,8 +408,11 @@ class UI(object): def build_statusbar(self): """construct and return statusbar widget""" - idx = self.buffers.index(self.current_buffer) - lefttxt = '%d: %s' % (idx, self.current_buffer) + if self.current_buffer is not None: + idx = self.buffers.index(self.current_buffer) + lefttxt = '%d: %s' % (idx, self.current_buffer) + else: + lefttxt = '[no buffers]' footerleft = urwid.Text(lefttxt, align='left') righttxt = 'total messages: %d' % self.dbman.count_messages('*') pending_writes = len(self.dbman.writequeue) -- cgit v1.2.3