diff options
-rw-r--r-- | alot/buffers.py | 2 | ||||
-rw-r--r-- | alot/commands/bufferlist.py | 9 | ||||
-rw-r--r-- | alot/commands/globals.py | 10 | ||||
-rw-r--r-- | alot/ui.py | 5 |
4 files changed, 13 insertions, 13 deletions
diff --git a/alot/buffers.py b/alot/buffers.py index fc485a08..7459c98f 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -67,8 +67,6 @@ class BufferlistBuffer(Buffer): return self.ui.buffers.index(b) def rebuild(self): - self.ui.logger.debug('BUFFERS') - self.ui.logger.debug(self.ui.buffers) if self.isinitialized: focusposition = self.bufferlist.get_focus()[1] else: diff --git a/alot/commands/bufferlist.py b/alot/commands/bufferlist.py index ae8ffc01..eaf0ef73 100644 --- a/alot/commands/bufferlist.py +++ b/alot/commands/bufferlist.py @@ -14,8 +14,9 @@ class BufferFocusCommand(Command): @registerCommand(MODE, 'close', help='close focussed buffer') class BufferCloseCommand(Command): def apply(self, ui): - selected = ui.current_buffer.get_selected_buffer() - if isinstance(selected, buffers.SearchBuffer): - selected.kill_filler_process() + bufferlist = ui.current_buffer + selected = bufferlist.get_selected_buffer() ui.buffer_close(selected) - ui.buffer_focus(ui.current_buffer) + if bufferlist is not selected: + bufferlist.rebuild() + ui.update() diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 8b1ddc50..3739bd6f 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -33,7 +33,8 @@ class ExitCommand(Command): if (yield ui.choice('realy quit?', select='yes', cancel='no', msg_position='left')) == 'no': return - ui.dbman.kill_search_processes() + for b in ui.buffers: + b.cleanup() ui.exit() @@ -209,10 +210,7 @@ class PythonShellCommand(Command): class BufferCloseCommand(Command): def apply(self, ui): selected = ui.current_buffer - if isinstance(selected, buffers.SearchBuffer): - selected.kill_filler_process() ui.buffer_close(selected) - ui.buffer_focus(ui.current_buffer) @registerCommand(MODE, 'bprevious', forced={'offset': -1}, @@ -248,7 +246,9 @@ class OpenBufferlistCommand(Command): if blists: ui.buffer_focus(blists[0]) else: - ui.buffer_open(buffers.BufferlistBuffer(ui, self.filtfun)) + bl = buffers.BufferlistBuffer(ui, self.filtfun) + ui.buffer_open(bl) + bl.rebuild() @registerCommand(MODE, 'taglist', help='opens taglist buffer') @@ -230,12 +230,13 @@ class UI(object): index = buffers.index(buf) buffers.remove(buf) offset = config.getint('general', 'bufferclose_focus_offset') - self.current_buffer = buffers[(index + offset) % len(buffers)] + nextbuffer = buffers[(index + offset) % len(buffers)] + self.buffer_focus(nextbuffer) else: string = 'closing buffer %d:%s' self.logger.debug(string % (buffers.index(buf), buf)) - index = buffers.index(buf) buffers.remove(buf) + buf.cleanup() def buffer_focus(self, buf): """ |