Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediately remove unread tag from single-message threads #1583

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions alot/buffers/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,18 @@ def render(self, size, focus=False):

if settings.get('auto_remove_unread'):
logging.debug('Tbuffer: auto remove unread tag from msg?')

msg = self.get_selected_message()
mid = msg.get_message_id()
focus_pos = self.body.get_focus()[1]
summary_pos = (self.body.get_focus()[1][0], (0,))
cursor_on_non_summary = (focus_pos != summary_pos)

if self.message_count > 1:
focus_pos = self.body.get_focus()[1]
summary_pos = (self.body.get_focus()[1][0], (0,))
cursor_on_non_summary = (focus_pos != summary_pos)
else:
# Immediately remove unread tag from single-message threads
cursor_on_non_summary = True

if cursor_on_non_summary:
if mid not in self._auto_unread_dont_touch_mids:
if 'unread' in msg.get_tags():
Expand Down