From fa0939622becdbab1063150a67ef3910dbbedf54 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 11 Sep 2011 19:29:14 +0200 Subject: Fix an issue that breaks the message display if it contains \t --- src/room.py | 2 +- src/text_buffer.py | 2 +- src/windows.py | 2 -- 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]+'…' -- cgit v1.2.3