summaryrefslogtreecommitdiff
path: root/src/window.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-13 00:09:28 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-13 00:09:28 +0000
commit48e83924d6cc55fcc9e40ad38c6f6ed0126a3cd5 (patch)
tree45e97e0dd89c83cae2b9e18b92695fef19fe4499 /src/window.py
parentcd4e857942f05977598b4633bf22ea4d0b471500 (diff)
downloadpoezio-48e83924d6cc55fcc9e40ad38c6f6ed0126a3cd5.tar.gz
poezio-48e83924d6cc55fcc9e40ad38c6f6ed0126a3cd5.tar.bz2
poezio-48e83924d6cc55fcc9e40ad38c6f6ed0126a3cd5.tar.xz
poezio-48e83924d6cc55fcc9e40ad38c6f6ed0126a3cd5.zip
comment cleanup, and fix another issue with empty text lines.
Diffstat (limited to 'src/window.py')
-rw-r--r--src/window.py23
1 files changed, 6 insertions, 17 deletions
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