home · contact · privacy
Fix log line coloring reverting to default after line break. master
authorChristian Heller <c.heller@plomlompom.de>
Sat, 4 Oct 2025 20:12:05 +0000 (22:12 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 4 Oct 2025 20:12:05 +0000 (22:12 +0200)
src/ircplom/tui_base.py

index 4ab6dd14970a9d6dd726c413a8329cf1f23a7e49..d910ccbd5bbaf583dc3ba3c1d8046e5e7d49da88 100644 (file)
@@ -170,9 +170,10 @@ class _HistoryWidget(_ScrollableWidget):
 
         to_write_w_attrs: list[tuple[Optional[str], str]] = []
         prev_idx_unwrapped: Optional[int] = -1
+        attrs: list[str]
         for idx_unwrapped, line in wrapped[start_idx_neg:end_idx_neg]:
-            attrs = ['on_black']
             if idx_unwrapped != prev_idx_unwrapped:
+                attrs = ['on_black']
                 for c in line.split(LOG_FMT_SEP, maxsplit=1)[0]:
                     attrs += list(LOG_FMT_ATTRS.get(c, tuple()))
                 prev_idx_unwrapped = idx_unwrapped