aboutsummaryrefslogtreecommitdiffstats
path: root/epy.py
diff options
context:
space:
mode:
authorbenadha <benawiadha@gmail.com>2019-10-25 16:37:01 +0700
committerbenadha <benawiadha@gmail.com>2019-10-25 16:57:25 +0700
commitb635668356848fe59fd4ac8ab6a899c0fda648aa (patch)
tree1a41dc10e2bfe9314571bd9f6cd309af6f84d4a0 /epy.py
parent046e5ea3ccbca1c8c0024ae56a408eac3d3208da (diff)
downloadepy-b635668356848fe59fd4ac8ab6a899c0fda648aa.tar.gz
More flexible on terminal resize, no more random error when resizing terminal agressively.
Diffstat (limited to 'epy.py')
-rw-r--r--epy.py6
1 files changed, 5 insertions, 1 deletions
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)