home · contact · privacy
Mark unread highlights in status line windows summary.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 29 Sep 2025 08:19:32 +0000 (10:19 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 29 Sep 2025 08:19:32 +0000 (10:19 +0200)
src/ircplom/tui_base.py

index a7d88e57f154c8b5d8e3c119db6e25988ecd2982..abfe67e111e7fa8d044b1eb94c5735cf197d1f57 100644 (file)
@@ -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}]'