From 48e83924d6cc55fcc9e40ad38c6f6ed0126a3cd5 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Sun, 13 Jun 2010 00:09:28 +0000 Subject: comment cleanup, and fix another issue with empty text lines. --- src/window.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/window.py') diff --git a/src/window.py b/src/window.py index 85084573..7b55e43e 100644 --- a/src/window.py +++ b/src/window.py @@ -52,9 +52,6 @@ class UserList(Win): def __init__(self, height, width, y, x, parent_win, visible): Win.__init__(self, height, width, y, x, parent_win) self.visible = visible - self.win.attron(curses.color_pair(2)) - # self.win.vline(0, 0, curses.ACS_VLINE, self.height) - self.win.attroff(curses.color_pair(2)) self.color_role = {'moderator': 2, 'participant':3, 'visitor':4 @@ -157,19 +154,8 @@ class RoomInfo(Win): class TextWin(Win): """ - # keep a dict of {winname: window} - # when a new message is received in a room, just add - # the line at the bottom (and scroll if needed) - # when the current room is changed, just refresh the - # associated window - # When the term is resized, rebuild ALL the windows - # (the complete lines lists are keeped in the Room class) - Nope, don't do that anymore. - Weechat is doing it the easy way, and it's working, there's no - reason poezio can't do it (it's python, but that shouldn't change - anything) Just keep ONE single window for the text area and rewrite EVERYTHING - on each change. + on each change. (thanks weechat :o) """ def __init__(self, height, width, y, x, parent_win, visible): self.visible = visible @@ -202,8 +188,9 @@ class TextWin(Win): limit = txt[:self.width-offset].find('\n') else: limit = self.width-offset-1 - if limit == 0: - break + # if limit == 0: + # txt = txt[1:] + # continue color = message.user.color if message.user else None if not first: nick = None @@ -212,6 +199,8 @@ class TextWin(Win): txt[:limit], message.color, offset) lines.append(l) + if limit == 0: + limit = 1 txt = txt[limit:] first = False return lines[-len(messages):]# return only the needed number of lines -- cgit v1.2.3