summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-13 01:59:50 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-13 01:59:50 +0200
commitb33a09f0f6439fa8e9f7a4dbc38bf6f17465f641 (patch)
treeb10da73f0c599521b793edf54af07125e478d93b
parentc8d80807c7580c4f723983d27408823bcee1b578 (diff)
downloadpoezio-b33a09f0f6439fa8e9f7a4dbc38bf6f17465f641.tar.gz
poezio-b33a09f0f6439fa8e9f7a4dbc38bf6f17465f641.tar.bz2
poezio-b33a09f0f6439fa8e9f7a4dbc38bf6f17465f641.tar.xz
poezio-b33a09f0f6439fa8e9f7a4dbc38bf6f17465f641.zip
Keep one bool LESS in each line, YAY, that’s HUGE.
-rw-r--r--src/windows.py9
1 files 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: