From b9b1b1b8f3410b8023cb3898bfc0f2adbb4f41b0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 11 May 2022 15:11:18 +0200 Subject: commands/globals:BufferCloseCommand: drop unused redraw param Drop it also from the corresponding UI functions, where it does not do anything. --- alot/commands/globals.py | 8 ++------ alot/ui.py | 6 +++--- 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 -- cgit v1.2.3