From b33a09f0f6439fa8e9f7a4dbc38bf6f17465f641 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 13 Sep 2011 01:59:50 +0200 Subject: [PATCH] =?UTF-8?q?Keep=20one=20bool=20LESS=20in=20each=20line,=20?= =?UTF-8?q?YAY,=20that=E2=80=99s=20HUGE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/windows.py b/src/windows.py index e4ec29cf..74d3b398 100644 --- a/src/windows.py +++ b/src/windows.py @@ -45,7 +45,7 @@ import collections # msg is a reference to the corresponding Message tuple. text_start and text_end are the position # delimiting the text in this line. # first is a bool telling if this is the first line of the message. -Line = collections.namedtuple('Line', 'msg start_pos end_pos first') +Line = collections.namedtuple('Line', 'msg start_pos end_pos') g_lock = Lock() @@ -567,13 +567,10 @@ class TextWin(Win): if theme.CHAR_TIME_RIGHT: offset += 1 lines = cut_text(txt, self.width-offset) - first = True for line in lines: self.built_lines.append(Line(msg=message, start_pos=line[0], - end_pos=line[1], - first=first)) - first = False + end_pos=line[1])) if clean: while len(self.built_lines) > self.lines_nb_limit: self.built_lines.pop(0) @@ -595,7 +592,7 @@ class TextWin(Win): self.write_line_separator() else: msg = line.msg - if line.first: + if line.start_pos == 0: if msg.nick_color: color = msg.nick_color elif msg.user: