From b635668356848fe59fd4ac8ab6a899c0fda648aa Mon Sep 17 00:00:00 2001 From: benadha Date: Fri, 25 Oct 2019 16:37:01 +0700 Subject: More flexible on terminal resize, no more random error when resizing terminal agressively. --- epy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'epy.py') diff --git a/epy.py b/epy.py index 96efaeb..1466dd3 100644 --- a/epy.py +++ b/epy.py @@ -874,7 +874,11 @@ def reader(stdscr, ebook, index, width, y, pctg, sect): stdscr.clear() stdscr.refresh() - pad.refresh(y, 0, 0, x, rows-1, x+width) + # try except to be more flexible on terminal resize + try: + pad.refresh(y, 0, 0, x, rows-1, x+width) + except curses.error: + pass if sect != "": y = toc_secid.get(sect, 0) -- cgit