diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-06-26 20:19:09 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-06-26 20:19:09 +0100 |
commit | b4108964261d2586401c232939c638be41ebd71a (patch) | |
tree | 108d25f52d5ad915fd6248fe06928d6572d5de26 /alot/ui.py | |
parent | 1e66018acc312c9bec6c21ce25cd5cac91f6762d (diff) |
insert new buffers relative to current buffer
.. in UI's bufferlist. This results in a more natural bufferflow
when going from a search to thread and back by closing the thread.
cf issue #478
Diffstat (limited to 'alot/ui.py')
-rw-r--r-- | alot/ui.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -198,7 +198,12 @@ class UI(object): def buffer_open(self, buf): """register and focus new :class:`~alot.buffers.Buffer`.""" - self.buffers.append(buf) + if self.current_buffer is not None: + offset = settings.get('bufferclose_focus_offset') * -1 + currentindex = self.buffers.index(self.current_buffer) + self.buffers.insert(currentindex + offset, buf) + else: + self.buffers.append(buf) self.buffer_focus(buf) def buffer_close(self, buf): |