diff options
author | pazz <patricktotzke@gmail.com> | 2011-07-16 22:18:14 +0100 |
---|---|---|
committer | pazz <patricktotzke@gmail.com> | 2011-07-16 22:18:14 +0100 |
commit | 5c91af749d7b8971e877e279a1bba17e496d5bac (patch) | |
tree | 6567cba26004cf0f6ff8cc341a5b2d1fb8315b52 /alot/commands.py | |
parent | dcf49c603870546c634dbb9fa13e0f4faeca430a (diff) |
fix bufferlist
Diffstat (limited to 'alot/commands.py')
-rw-r--r-- | alot/commands.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/alot/commands.py b/alot/commands.py index 515b904b..1d1b6769 100644 --- a/alot/commands.py +++ b/alot/commands.py @@ -218,12 +218,14 @@ class BufferFocusCommand(Command): Command.__init__(self, **kwargs) def apply(self, ui): - if not self.buffer: - self.buffer = ui.current_buffer - idx = ui.buffers.index(self.buffer) - num = len(ui.buffers) - to_be_focused = ui.buffers[(idx + self.offset) % num] - ui.buffer_focus(to_be_focused) + if self.offset: + idx = ui.buffers.index(ui.current_buffer) + num = len(ui.buffers) + self.buffer = ui.buffers[(idx + self.offset) % num] + else: + if not self.buffer: + self.buffer = ui.current_buffer.get_selected_buffer() + ui.buffer_focus(self.buffer) class OpenBufferListCommand(Command): |