diff options
author | wustho <benawiadha@gmail.com> | 2020-09-24 02:51:35 +0000 |
---|---|---|
committer | wustho <benawiadha@gmail.com> | 2020-09-24 02:51:35 +0000 |
commit | 5e015b52da4a921d063c404dfc5d00227c8e82b8 (patch) | |
tree | 4d3415ea010622609ac5b7c093f331364911001c /epy.py | |
parent | f291ebeeee65ef196a12219ae1a0a0ec64b5e4d1 (diff) | |
download | epy-5e015b52da4a921d063c404dfc5d00227c8e82b8.tar.gz |
Better PageDown in Board() but still not quite there when searching().
Diffstat (limited to 'epy.py')
-rwxr-xr-x | epy.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -14,7 +14,7 @@ Options: """ -__version__ = "2020.9.22" +__version__ = "2020.9.24" __license__ = "GPL-3.0" __author__ = "Benawi Adha" __url__ = "https://github.com/wustho/epy" @@ -1194,6 +1194,10 @@ def searching(pad, src, width, y, ch, tot): elif s == curses.KEY_RESIZE: return s + # TODO + if y+rows-1 > pad.chunks[pad.find_chunkidx(y)]: + y = pad.chunks[pad.find_chunkidx(y)] + 1 + while found[sidx][0] not in list(range(y, y+rows-1)): if found[sidx][0] > y: y += rows - 1 @@ -1442,7 +1446,10 @@ def reader(ebook, index, width, y, pctg, sect): y = totlines - rows elif k in K["PageDown"]: if totlines - y - LINEPRSRV > rows: - y += rows - LINEPRSRV + if y+rows > pad.chunks[pad.find_chunkidx(y)]: + y = pad.chunks[pad.find_chunkidx(y)] + 1 + else: + y += rows - LINEPRSRV # SCREEN.clear() # SCREEN.refresh() elif index != len(contents)-1: |