summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2017-02-14 09:06:00 +0000
committerGitHub <noreply@github.com>2017-02-14 09:06:00 +0000
commit333fcaed50296402aaf24f226d38ff93599bcd25 (patch)
treee5bb19d11fd483329dea09b64b07c018aef34c85
parent840feadee7859257646d6d830420dc8b153725ad (diff)
parentf8b714b40c2ee4dc47a3c71d89c12ebb02fcee35 (diff)
Merge pull request #1029 from pazz/linewise
optional linewise focussing in thread mode
-rw-r--r--alot/defaults/alot.rc.spec6
-rw-r--r--alot/widgets/thread.py10
-rw-r--r--docs/source/configuration/alotrc_table12
3 files changed, 26 insertions, 2 deletions
diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec
index 3b5d975b..ad61c178 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 70e7c840..1635d52d 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -94,8 +94,14 @@ class TextlinesList(SimpleTree):
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 855c3f6a..b15ec412 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