diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-03-29 14:35:59 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-03-29 14:35:59 +0200 |
commit | 38cffe43b6adab115fb65635034a0b2db9f2c26d (patch) | |
tree | b45e751374b8e0da8bf4046ae8c555d1b0cf5cee /src/windows.py | |
parent | 8b032a6ece601c74ea0d9cf4f0c7a3e1ae72bcb2 (diff) | |
download | poezio-38cffe43b6adab115fb65635034a0b2db9f2c26d.tar.gz poezio-38cffe43b6adab115fb65635034a0b2db9f2c26d.tar.bz2 poezio-38cffe43b6adab115fb65635034a0b2db9f2c26d.tar.xz poezio-38cffe43b6adab115fb65635034a0b2db9f2c26d.zip |
Message and complete words can now be colored even if the
take more than one line to be displayed.
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/windows.py b/src/windows.py index eaa8da68..cecd9b0d 100644 --- a/src/windows.py +++ b/src/windows.py @@ -112,7 +112,6 @@ class Win(object): if y is not None and x is not None: self._win.move(y, x) next_attr_char = string.find('\x19') - self._win.attrset(0) # reset all attr while next_attr_char != -1: attr_char = string[next_attr_char+1].lower() if next_attr_char != 0: @@ -128,7 +127,6 @@ class Win(object): self._win.attron(common.curses_color_pair(int(attr_char))) next_attr_char = string.find('\x19') self.addstr(string) - self._win.attrset(0) def finish_line(self, color): """ @@ -608,9 +606,16 @@ class TextWin(Win): else: self.write_time(line.time) self.write_nickname(line.nickname, line.nickname_color) - self.write_text(y, line.text_offset, line.text) if y != self.height-1: self.addstr('\n') + self._win.attrset(0) + for y, line in enumerate(lines): + if not line: + continue + self.write_text(y, line.text_offset, line.text) + if y != self.height-1: + self.addstr('\n') + self._win.attrset(0) self._refresh() def write_line_separator(self): |