diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec index 3b5d975bc..ad61c178e 100644 --- a/alot/defaults/alot.rc.spec +++ b/alot/defaults/alot.rc.spec @@ -256,6 +256,12 @@ history_size = integer(default=50) # The number of seconds to wait between calls to the loop_hook periodic_hook_frequency = integer(default=300) +# Split message body linewise and allows to (move) the focus to each individual +# line. Setting this to False will result in one potentially big text widget +# for the whole message body. +thread_focus_linewise = boolean(default=True) + + # Key bindings [bindings] __many__ = string(default=None) diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py index 70e7c840b..1635d52d6 100644 --- a/alot/widgets/thread.py +++ b/alot/widgets/thread.py @@ -94,8 +94,14 @@ def __init__(self, content, attr=None, attr_focus=None): for each line in content. """ structure = [] - for line in content.splitlines(): - structure.append((FocusableText(line, attr, attr_focus), None)) + + # depending on this config setting, we either add individual lines + # or the complete context as focusable objects. + if settings.get('thread_focus_linewise'): + for line in content.splitlines(): + structure.append((FocusableText(line, attr, attr_focus), None)) + else: + structure.append((FocusableText(content, attr, attr_focus), None)) SimpleTree.__init__(self, structure) diff --git a/docs/source/configuration/alotrc_table b/docs/source/configuration/alotrc_table index 855c3f6a7..b15ec4123 100644 --- a/docs/source/configuration/alotrc_table +++ b/docs/source/configuration/alotrc_table @@ -633,6 +633,18 @@ :default: True +.. _thread-focus-linewise: + +.. describe:: thread_focus_linewise + + Split message body linewise and allows to (move) the focus to each individual + line. Setting this to False will result in one potentially big text widget + for the whole message body. + + :type: boolean + :default: True + + .. _thread-statusbar: .. describe:: thread_statusbar