From 410e6dc2596723201caecdc23e9a17fd8d598ccc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 21 Oct 2016 18:10:15 +0530 Subject: [PATCH] Micro-optimization --- kitty/screen.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kitty/screen.py b/kitty/screen.py index 997d2e9e9..e32e0ae18 100644 --- a/kitty/screen.py +++ b/kitty/screen.py @@ -462,7 +462,10 @@ class Screen(QObject): self.tophistorybuf.append(l) self.line_added_to_history() self.linebuf.insert(bottom, Line(self.columns)) - self.update_screen() + if bottom - top >= self.lines - 1: + self.update_screen() + else: + self.update_line_range(top, bottom) else: self.cursor_down() @@ -475,7 +478,10 @@ class Screen(QObject): if self.cursor.y == top: self.linebuf.pop(bottom) self.linebuf.insert(top, Line(self.columns)) - self.update_screen() + if bottom - top >= self.lines - 1: + self.update_screen() + else: + self.update_line_range(top, bottom) else: self.cursor_up()