diff options
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/bufferlist.py | 12 | ||||
-rw-r--r-- | alot/commands/globals.py | 2 | ||||
-rw-r--r-- | alot/commands/search.py | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/alot/commands/bufferlist.py b/alot/commands/bufferlist.py index c638f8a0..ef58c6fc 100644 --- a/alot/commands/bufferlist.py +++ b/alot/commands/bufferlist.py @@ -21,7 +21,11 @@ class BufferCloseCommand(Command): def apply(self, ui): bufferlist = ui.current_buffer selected = bufferlist.get_selected_buffer() - ui.apply_command(globals.BufferCloseCommand(buffer=selected)) - if bufferlist is not selected: - bufferlist.rebuild() - ui.update() + d = ui.apply_command(globals.BufferCloseCommand(buffer=selected)) + + def cb(ignoreme): + if bufferlist is not selected: + bufferlist.rebuild() + ui.update() + d.addCallback(cb) + return d diff --git a/alot/commands/globals.py b/alot/commands/globals.py index de6fcb71..30331299 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -406,7 +406,7 @@ class BufferCloseCommand(Command): select='yes', cancel='no', msg_position='left')) == 'no'): - return + raise CommandCanceled() if len(ui.buffers) == 1: if settings.get('quit_on_last_bclose'): diff --git a/alot/commands/search.py b/alot/commands/search.py index 5ff61b44..e5307394 100644 --- a/alot/commands/search.py +++ b/alot/commands/search.py @@ -88,7 +88,7 @@ class RefinePromptCommand(Command): def apply(self, ui): sbuffer = ui.current_buffer oldquery = sbuffer.querystring - ui.apply_command(PromptCommand('refine ' + oldquery)) + return ui.apply_command(PromptCommand('refine ' + oldquery)) @registerCommand(MODE, 'retagprompt') |