break words even on the last line

This commit is contained in:
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 2010-06-30 10:30:46 +00:00
parent dc39cdab50
commit 450c234cd3

View file

@ -216,8 +216,8 @@ class TextWin(Win):
limit = txt[:self.width-offset].find('\n') limit = txt[:self.width-offset].find('\n')
else: else:
# break between words if possible # break between words if possible
if len(txt) >= self.width: if len(txt) >= self.width-offset:
limit = txt[:self.width-offset-1].rfind(' ') limit = txt[:self.width-offset].rfind(' ')
this_line_was_broken_by_space = True this_line_was_broken_by_space = True
if limit <= 0: if limit <= 0:
limit = self.width-offset-1 limit = self.width-offset-1