summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-11 19:29:14 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-11 19:29:14 +0200
commitfa0939622becdbab1063150a67ef3910dbbedf54 (patch)
treeac919df57af91593edbea2a3d147ef1d6edd57d7
parent96794a4e4992b3f0bbcb57782c0f67981c1eb8e2 (diff)
downloadpoezio-fa0939622becdbab1063150a67ef3910dbbedf54.tar.gz
poezio-fa0939622becdbab1063150a67ef3910dbbedf54.tar.bz2
poezio-fa0939622becdbab1063150a67ef3910dbbedf54.tar.xz
poezio-fa0939622becdbab1063150a67ef3910dbbedf54.zip
Fix an issue that breaks the message display if it contains \t
-rw-r--r--src/room.py2
-rw-r--r--src/text_buffer.py2
-rw-r--r--src/windows.py2
3 files changed, 2 insertions, 4 deletions
diff --git a/src/room.py b/src/room.py
index 674e2d65..be376b54 100644
--- a/src/room.py
+++ b/src/room.py
@@ -119,7 +119,7 @@ class Room(TextBuffer):
if highlight:
nick_color = highlight
time = time or datetime.now()
- message = Message(txt='%s\x19o'%(txt,), nick_color=nick_color,
+ message = Message(txt='%s\x19o'%(txt.replace('\t', ' '),), nick_color=nick_color,
time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\
if history else time.strftime("%H:%M:%S"),\
nickname=nickname, user=user)
diff --git a/src/text_buffer.py b/src/text_buffer.py
index 314b9896..d89dbfb9 100644
--- a/src/text_buffer.py
+++ b/src/text_buffer.py
@@ -37,7 +37,7 @@ class TextBuffer(object):
def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None):
time = time or datetime.now()
- msg = Message(txt='%s\x19o'%(txt,), nick_color=nick_color,
+ msg = Message(txt='%s\x19o'%(txt.replace('\t', ' '),), nick_color=nick_color,
time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\
if history else time.strftime("%H:%M:%S"),\
nickname=nickname, user=None)
diff --git a/src/windows.py b/src/windows.py
index 68e5df6a..29f80007 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -552,8 +552,6 @@ class TextWin(Win):
txt = message.txt
if not txt:
return 0
- else:
- txt = txt.replace('\t', ' ')
nick = message.nickname
if nick and len(nick) >= 25:
nick = nick[:25]+'…'