Skip to content

Commit

Permalink
Merge pull request #1029 from pazz/linewise
Browse files Browse the repository at this point in the history
optional linewise focussing in thread mode
  • Loading branch information
pazz committed Feb 14, 2017
2 parents 840fead + f8b714b commit 333fcae
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions alot/defaults/alot.rc.spec
Expand Up @@ -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)
Expand Down
10 changes: 8 additions & 2 deletions alot/widgets/thread.py
Expand Up @@ -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)


Expand Down
12 changes: 12 additions & 0 deletions docs/source/configuration/alotrc_table
Expand Up @@ -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
Expand Down

0 comments on commit 333fcae

Please sign in to comment.