- commit
- 4f405567c2ca0d4db3769002383fee940ede5108
- parent
- 2d2aa960398c4195ffbbd9756f970b45002eb19c
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-07-13 06:02
fix: force full render on resize
Diffstat
| M | boon.py | 6 | +++--- |
1 files changed, 3 insertions, 3 deletions
diff --git a/boon.py b/boon.py
@@ -92,10 +92,10 @@ class App: 92 92 self.running = False 93 93 signal.signal(signal.SIGWINCH, self.on_resize) 94 9495 -1 def update(self):-1 95 def update(self, force=False): 96 96 lines = list(self.render(self.rows, self.cols)) 97 97 for i, line in enumerate(lines):98 -1 if len(self.old_lines) > i and line == self.old_lines[i]:-1 98 if not force and len(self.old_lines) > i and line == self.old_lines[i]: 99 99 continue 100 100 move(i, 0) 101 101 sys.stdout.write(get_cap('el')) @@ -111,7 +111,7 @@ class App: 111 111 112 112 def on_resize(self, *args): 113 113 self.cols, self.rows = shutil.get_terminal_size()114 -1 self.update()-1 114 self.update(force=True) 115 115 116 116 def run(self): 117 117 self.running = True