summaryrefslogtreecommitdiff
path: root/poezio/windows
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-10-27 14:46:01 +0100
committermathieui <mathieui@mathieui.net>2020-05-09 19:46:17 +0200
commit3d13d1d99494a5795ca516939d49c2ad2397e1a9 (patch)
tree7e61f21d1a212d81f38e2533599430ca5287bcd4 /poezio/windows
parentcad5d0d88a29195f287fbaea0cbfeac4463422d3 (diff)
downloadpoezio-3d13d1d99494a5795ca516939d49c2ad2397e1a9.tar.gz
poezio-3d13d1d99494a5795ca516939d49c2ad2397e1a9.tar.bz2
poezio-3d13d1d99494a5795ca516939d49c2ad2397e1a9.tar.xz
poezio-3d13d1d99494a5795ca516939d49c2ad2397e1a9.zip
Typing improvements
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