From: Christian Heller Date: Mon, 29 Sep 2025 08:19:32 +0000 (+0200) Subject: Mark unread highlights in status line windows summary. X-Git-Url: https://plomlompom.com/repos/?a=commitdiff_plain;h=75422f77ae9c7fb5e706e8c0102cad6bd81f15b1;p=ircplom Mark unread highlights in status line windows summary. --- diff --git a/src/ircplom/tui_base.py b/src/ircplom/tui_base.py index a7d88e5..abfe67e 100644 --- a/src/ircplom/tui_base.py +++ b/src/ircplom/tui_base.py @@ -175,6 +175,12 @@ class _HistoryWidget(_ScrollableWidget): 'Store to what most recent line we have (been) scrolled.' self._bookmark_idx_pos = self._last_read_idx_pos + 1 + @property + def has_unread_highlight(self) -> bool: + 'Whether any of the unread lines are marked for highlighting.' + return bool([line for line in self._history[-self.n_lines_unread:] + if line.startswith('*')]) + @property def n_lines_unread(self) -> int: 'How many new lines have been logged since last focus.' @@ -320,6 +326,8 @@ class _StatusLine(_Widget): item = str(w.idx) if (n := w.history.n_lines_unread): item = f'({item}:{n})' + if w.history.has_unread_highlight: + item = f'*{item}' if w.idx == self.idx_focus: focused = w item = f'[{item}]'