summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-02-14 14:54:56 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-02-14 14:54:56 +0100
commit85d645b7d27a940c262d0a1e333c61754877155e (patch)
tree3e6d25ffa0ce92f108076be05e80f791925b8533 /src/windows.py
parent8d0ebdfc123890048f7d282077c4e3ab0b845bba (diff)
parent4b31e5acf142664c2f2ebd2e0cfa26e700d947d7 (diff)
downloadpoezio-85d645b7d27a940c262d0a1e333c61754877155e.tar.gz
poezio-85d645b7d27a940c262d0a1e333c61754877155e.tar.bz2
poezio-85d645b7d27a940c262d0a1e333c61754877155e.tar.xz
poezio-85d645b7d27a940c262d0a1e333c61754877155e.zip
Automated merge with http://hg.louiz.org/poezio
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/windows.py b/src/windows.py
index 68e4de62..479ec797 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -433,8 +433,9 @@ class MucInfoWin(InfoWin):
self.addstr(txt, common.curses_color_pair(theme.COLOR_INFORMATION_BAR))
class TextWin(Win):
- def __init__(self):
+ def __init__(self, lines_nb_limit=config.get('max_lines_in_memory', 2048)):
Win.__init__(self)
+ self.lines_nb_limit = lines_nb_limit
self.pos = 0
self.built_lines = [] # Each new message is built and kept here.
# on resize, we rebuild all the messages
@@ -526,7 +527,7 @@ class TextWin(Win):
if txt.startswith('\n'):
txt = txt[1:]
first = False
- while len(self.built_lines) > LINES_NB_LIMIT:
+ while len(self.built_lines) > self.lines_nb_limit:
self.built_lines.pop(0)
return nb