From b9a066a096fbe225e653cf0b8380f0b36fd1c78f Mon Sep 17 00:00:00 2001 From: devfred78 <97401939+devfred78@users.noreply.github.com> Date: Sun, 13 Feb 2022 13:20:54 +0100 Subject: [PATCH] fix console re-init when dimensions are changed --- pygconsole/console.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pygconsole/console.py b/pygconsole/console.py index 709422f..1539d69 100644 --- a/pygconsole/console.py +++ b/pygconsole/console.py @@ -587,10 +587,7 @@ class Console(): if value > 0: self._width = value # Console re-init - self._presentation_stream = deque([None] * self._width * self._height, self._char_memory_size) - self._cursor = 0 - self._start_window = 0 - self._end_window = self._width * self._height - 1 + self._init_console() else: self.log.warning(f"Console width cannot be negative. The previous value is kept: {self._width}") @property @@ -607,10 +604,7 @@ class Console(): if value > 0: self._height = value # Console re-init - self._presentation_stream = deque([None] * self._width * self._height, self._char_memory_size) - self._cursor = 0 - self._start_window = 0 - self._end_window = self._width * self._height - 1 + self._init_console() else: self.log.warning(f"Console height cannot be negative. The previous value is kept: {self._height}") #############################################################