From 8c28434d413c15c941f659f3661f37d55837d6b1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 21 Oct 2016 10:03:44 +0530 Subject: [PATCH] Dont dirty the tracker on object creation needlessly --- kitty/screen.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/screen.py b/kitty/screen.py index e7fd0e8ce..42a39e77e 100644 --- a/kitty/screen.py +++ b/kitty/screen.py @@ -64,7 +64,7 @@ class Screen(QObject): self.tophistorybuf = deque(maxlen=sz) self.main_linebuf, self.alt_linebuf = list(Line(self.columns) for i in range(self.lines)), list(Line(self.columns) for i in range(self.lines)) self.linebuf = self.main_linebuf - self.reset() + self.reset(notify=False) def apply_opts(self, opts): sz = max(1000, opts.scrollback_lines) @@ -95,7 +95,7 @@ class Screen(QObject): self.restore_cursor() self.update_screen() - def reset(self): + def reset(self, notify=True): """Resets the terminal to its initial state. * Scroll margins are reset to screen boundaries. @@ -133,7 +133,8 @@ class Screen(QObject): self.cursor = Cursor(0, 0) self.cursor_changed(self.cursor) self.cursor_position() - self.update_screen() + if notify: + self.update_screen() def resize(self, lines: int, columns: int): """Resize the screen to the given dimensions.