summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-10 17:24:37 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-01-10 17:24:37 +0100
commit8e7b678506bd05fb7ade42d02628ca958fe32ba1 (patch)
treeb1d3e325db3e39e2021902f5f31dfc5d2bf46cca /src
parent67d3622e1d0befba1801e77880727a8b670d541b (diff)
downloadpoezio-8e7b678506bd05fb7ade42d02628ca958fe32ba1.tar.gz
poezio-8e7b678506bd05fb7ade42d02628ca958fe32ba1.tar.bz2
poezio-8e7b678506bd05fb7ade42d02628ca958fe32ba1.tar.xz
poezio-8e7b678506bd05fb7ade42d02628ca958fe32ba1.zip
Fix an error in textwin.refresh
a \n was added when the line was exactly the same width as the window, so the next nick was one line too low
Diffstat (limited to 'src')
-rw-r--r--src/windows.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/windows.py b/src/windows.py
index 83bc886f..e4b5bcb4 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -487,9 +487,8 @@ class TextWin(Win):
this_line_was_broken_by_space = False
nb = 0
while txt != '':
- if txt[:self.width-offset].find('\n') != -1:
- limit = txt[:self.width-offset].find('\n')
- else:
+ limit = txt[:self.width-offset].find('\n')
+ if limit < 0:
# break between words if possible
if len(txt) >= self.width-offset:
limit = txt[:self.width-offset].rfind(' ')
@@ -552,7 +551,7 @@ class TextWin(Win):
if line.nickname:
self.write_nickname(line.nickname, line.nickname_color)
self.write_text(y, line.text_offset, line.text, line.text_color, line.colorized)
- if y != self.height - 1:
+ if y != self.height-1 and line.text_offset+len(line.text) < self.width:
self.addstr('\n')
self._refresh()