summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2017-02-09 09:32:41 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2017-02-09 09:32:41 +0000
commitf8b714b40c2ee4dc47a3c71d89c12ebb02fcee35 (patch)
treed156c1e70291e3d4b4691f01c77e3559a63f70f5
parentc2b73f139998cd465133b5942a345875486ce514 (diff)
optional linewise focussing in thread mode
This introduces a new config option 'thread_focus_linewise', (defaults to True), which determines if the message texts are split into individually focussable lines in thread mode. fixes #645
-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 ae06890e..2e0bc0cb 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 a51079d9..c113ff13 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