summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/command.py1
-rw-r--r--alot/defaults/alot.rc3
-rw-r--r--alot/ui.py3
3 files changed, 6 insertions, 1 deletions
diff --git a/alot/command.py b/alot/command.py
index bbd7ed47..903036f5 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -241,6 +241,7 @@ class BufferCloseCommand(Command):
def apply(self, ui):
if self.focussed:
+ #if in bufferlist, this is ugly.
self.buffer = ui.current_buffer.get_selected_buffer()
elif not self.buffer:
self.buffer = ui.current_buffer
diff --git a/alot/defaults/alot.rc b/alot/defaults/alot.rc
index 67f767a8..917eabfe 100644
--- a/alot/defaults/alot.rc
+++ b/alot/defaults/alot.rc
@@ -9,6 +9,9 @@ authors_maxlength = 30
# confirm exit
bug_on_exit = False
+# offset of next focussed buffer if the current one gets closed
+bufferclose_focus_offset=-1
+
# number of colours your terminal supports
colourmode = 256
diff --git a/alot/ui.py b/alot/ui.py
index 5f89e99d..320f8efe 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -185,7 +185,8 @@ class UI(object):
self.logger.debug('UI: closing current buffer %s' % buf)
index = buffers.index(buf)
buffers.remove(buf)
- self.current_buffer = buffers[index % len(buffers)]
+ offset = config.getint('general', 'bufferclose_focus_offset')
+ self.current_buffer = buffers[(index + offset) % len(buffers)]
else:
string = 'closing buffer %d:%s'
self.logger.debug(string % (buffers.index(buf), buf))