From 75422f77ae9c7fb5e706e8c0102cad6bd81f15b1 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 29 Sep 2025 10:19:32 +0200 Subject: [PATCH] Mark unread highlights in status line windows summary. --- src/ircplom/tui_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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}]' -- 2.30.2