home · contact · privacy
Fix log depth cutoff not limiting negative history scroll index.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 23 Oct 2025 03:42:31 +0000 (05:42 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 23 Oct 2025 03:42:31 +0000 (05:42 +0200)
src/ircplom/tui_base.py
src/tests/tui_draw.test

index ef48d08efe2954fde584ddde6e15dc43014c9063..9793164887e9d4bf90a75765b6981cafcf09bd69 100644 (file)
@@ -174,6 +174,8 @@ class _HistoryWidget(_ScrollableWidget):
         if len(self._history) > self._maxlen_log:
             self._history = self._history[1:]
             self._history_offset += 1
+            self._history_idx_neg = max(self._history_idx_neg,
+                                        -self._maxlen_log)
             wrap_offset = 0
             for wrap_idx_pos, t in enumerate(self._wrapped):
                 if t[0] == self._history_offset:
index 814f15edf58247b6f7802b16434a56093578b744..ad4d1e9270c117ed91cfc77e8203c7e905b7a6f5 100644 (file)
@@ -598,5 +598,13 @@ insert history_1 1:2 +20
 insert scrolldown-29 : +21
 insert status-0-[1]-prompt : +22
 
+# check cut-off log growth seen from topmost scroll not affecting scrolldown count, but unread-lines status
+loggedservermsg 0 1 <.. PING :0
+log 1 >.. PONG :0
+insert lines-empty :20 +0
+insert history_1 3:4 +20
+insert scrolldown-29 : +21
+insert status-0-[1:2]-prompt : +22
+
 > /quit
 log 0 <..