diff options
Diffstat (limited to 'alot/commands/thread.py')
-rw-r--r-- | alot/commands/thread.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index fc6a4273..33230197 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -537,7 +537,8 @@ class EditNewCommand(Command): 'nargs': '*'})]) @registerCommand( MODE, 'indent', help='change message/reply indentation', - arguments=[(['indent'], {})]) + arguments=[(['indent'], {'action': cargparse.ValidatedStoreAction, + 'validator': cargparse.is_int_or_pm})]) class ChangeDisplaymodeCommand(Command): """fold or unfold messages""" @@ -576,8 +577,8 @@ class ChangeDisplaymodeCommand(Command): elif self.indent == '-': tbuffer._indent_width -= 1 else: - # TODO: I'm dangerous - tbuffer._indent_width = int(self.indent) + # argparse validation guarantees that self.indent is an integer + tbuffer._indent_width = self.indent tbuffer.rebuild() tbuffer.collapse_all() ui.update() |