summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-05-11 15:11:18 +0200
committerAnton Khirnov <anton@khirnov.net>2022-05-11 15:11:18 +0200
commitb9b1b1b8f3410b8023cb3898bfc0f2adbb4f41b0 (patch)
tree9dd6963f5f08c3c197a7502dbd6751b429b56b1c
parentba50cd942fd80dfca6e86a573e01b00b98b1f5f9 (diff)
commands/globals:BufferCloseCommand: drop unused redraw param
Drop it also from the corresponding UI functions, where it does not do anything.
-rw-r--r--alot/commands/globals.py8
-rw-r--r--alot/ui.py6
2 files changed, 5 insertions, 9 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 99451539..cb016d5d 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -413,9 +413,6 @@ class CallCommand(Command):
@registerCommand(MODE, 'bclose', arguments=[
- (['--redraw'],
- {'action': cargparse.BooleanAction,
- 'help': 'redraw current buffer after command has finished'}),
(['--force'],
{'action': 'store_true', 'help': 'never ask for confirmation'})])
class BufferCloseCommand(Command):
@@ -423,7 +420,7 @@ class BufferCloseCommand(Command):
"""close a buffer"""
repeatable = True
- def __init__(self, buffer=None, force=False, redraw=True, **kwargs):
+ def __init__(self, buffer=None, force=False, **kwargs):
"""
:param buffer: the buffer to close or None for current
:type buffer: `alot.buffers.Buffer`
@@ -432,7 +429,6 @@ class BufferCloseCommand(Command):
"""
self.buffer = buffer
self.force = force
- self.redraw = redraw
super().__init__(**kwargs)
async def apply(self, ui):
@@ -475,7 +471,7 @@ class BufferCloseCommand(Command):
if len(ui.buffers) == 1:
await one_buffer(prompt=False)
else:
- ui.buffer_close(self.buffer, self.redraw)
+ ui.buffer_close(self.buffer)
@registerCommand(MODE, 'bprevious', forced={'offset': -1},
diff --git a/alot/ui.py b/alot/ui.py
index 9e6de9eb..de1ca0ce 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -526,7 +526,7 @@ class UI:
if posthook is not None:
posthook(ui=self, dbm=self.dbman, buf=buf)
- def buffer_close(self, buf, redraw=True):
+ def buffer_close(self, buf):
"""
closes given :class:`~alot.buffers.Buffer`.
@@ -549,7 +549,7 @@ class UI:
buffers.remove(buf)
offset = settings.get('bufferclose_focus_offset')
nextbuffer = buffers[(index + offset) % len(buffers)]
- self.buffer_focus(nextbuffer, redraw)
+ self.buffer_focus(nextbuffer)
buf.cleanup()
success = True
else:
@@ -562,7 +562,7 @@ class UI:
if posthook is not None:
posthook(ui=self, dbm=self.dbman, buf=buf, success=success)
- def buffer_focus(self, buf, redraw=True):
+ def buffer_focus(self, buf):
"""focus given :class:`~alot.buffers.Buffer`."""
# call pre_buffer_focus hook