diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2013-08-10 22:30:48 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-10-30 20:56:39 +0000 |
commit | 057775bf834d585d992cf4f9bf2d82c12fc30c85 (patch) | |
tree | 7fdf58732a15df60a92209294ddefb31065ef67d /alot/commands/bufferlist.py | |
parent | 94f9fa003ff4d7f2e5ce685a74a36890017305ba (diff) |
return Deferreds in Command.apply
... in search.RefinePromptCommand,
bufferlist.BufferCloseCommand
and globals.BufferCloseCommand
Diffstat (limited to 'alot/commands/bufferlist.py')
-rw-r--r-- | alot/commands/bufferlist.py | 12 |
1 files changed, 8 insertions, 4 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 |