diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-11 15:34:56 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-11 15:35:27 +0000 |
commit | 50cb4629974c582eb6254c66dc7147d5bd53c669 (patch) | |
tree | 12466c9270a785af59e32629a58c917a01b595eb /alot/ui.py | |
parent | 943fe637e450262495c103e5136f683562522671 (diff) |
fix ui.build_statusbar if current_buffer is None
just display "[no buffers]" instead of buffer info in that case
Diffstat (limited to 'alot/ui.py')
-rw-r--r-- | alot/ui.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |