summaryrefslogtreecommitdiff
path: root/poezio/windows
diff options
context:
space:
mode:
Diffstat (limited to 'poezio/windows')
-rw-r--r--poezio/windows/text_win.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/poezio/windows/text_win.py b/poezio/windows/text_win.py
index 61ab4cc0..ce52e29d 100644
--- a/poezio/windows/text_win.py
+++ b/poezio/windows/text_win.py
@@ -318,11 +318,17 @@ class TextWin(Win):
with_timestamps = config.get('show_timestamps')
nick_size = config.get('max_nick_length')
for i in range(len(self.built_lines) - 1, -1, -1):
- if self.built_lines[i] and self.built_lines[i].msg.identifier == old_id:
+ current = self.built_lines[i]
+ if current is not None and current.msg.identifier == old_id:
index = i
- while index >= 0 and self.built_lines[index] and self.built_lines[index].msg.identifier == old_id:
+ while (
+ index >= 0
+ and current is not None
+ and current.msg.identifier == old_id
+ ):
self.built_lines.pop(index)
index -= 1
+ current = self.built_lines[index]
index += 1
lines = build_lines(
message, self.width, timestamp=with_timestamps, nick_size=nick_size