From e7e8b9122b353ed8c360dac0c324de35aa158ff8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 20 Sep 2013 20:44:56 +0200 Subject: only remove on up and down when needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/editor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/editor.py b/src/editor.py index 2f1898b..a7dce59 100644 --- a/src/editor.py +++ b/src/editor.py @@ -34,7 +34,6 @@ from line import * -## TODO everything should not be redraw when pressing up an down ## TODO colours should be configurable with rc file ## TODO ring limits should be configurable with rc file ## TODO widthless characters should be ignored when calculating the size a text @@ -278,12 +277,16 @@ class TextArea(): def ensure_y(): nonlocal stored + updates = False if self.y < self.offy: self.offy = self.y + updates = True if self.y - self.offy > self.height - 3: self.offy = self.y - self.height + 3 - update_status() - redraw() + updates = True + if updates: + update_status() + redraw() def letter_type(char): ## XXX how do we do this with unicode support return (char in string.whitespace) or (char in string.punctuation) -- cgit v1.2.3-70-g09d2