From cf2af6ef4a6754f324706d55aaf011f9e15e7ce7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 13 Jun 2014 12:35:09 +0200 Subject: make editring limit configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/editor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/editor.py b/src/editor.py index d5fb96a..af1055f 100644 --- a/src/editor.py +++ b/src/editor.py @@ -63,6 +63,11 @@ KILLRING_LIMIT = 50 :int The maximum size of the killring ''' +EDITRING_LIMIT = 100 +''' +:int The maximum size of the editring +''' + atleast = lambda x, minimum : (x is not None) and (x >= minimum) ''' @@ -203,7 +208,7 @@ class TextArea(): if height <= 0: height += int(screen_size[0]) - top + 1 self.fields, self.datamap, self.left, self.top, self.width, self.height = fields, datamap, left, top, width - 1, height self.innerleft = len(max(self.fields, key = len)) + 3 - self.killring, self.editring = Killring(limit = KILLRING_LIMIT), Editring() + self.killring, self.editring = Killring(limit = KILLRING_LIMIT), Editring(limit = EDITRING_LIMIT) data = lambda field : datamap[field] if field in datamap else '' self.lines = [Line(self, self.fields[y], data(self.fields[y]), y) for y in range(len(self.fields))] self.areawidth = self.width - self.innerleft -- cgit v1.2.3-70-g09d2