From 8131297b88d35a953f2471c76f91dfb16730d6ab Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sun, 21 Dec 2025 14:20:54 +0200 Subject: [PATCH] pager sizing fix --- deck/pager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deck/pager.py b/deck/pager.py index 5777f84..0aa5c3f 100644 --- a/deck/pager.py +++ b/deck/pager.py @@ -14,6 +14,7 @@ except: pass # additional constants +REAL_TERM_COLS = TERM_COLS - 1 # for the line ending character REAL_TERM_ROWS = TERM_ROWS - 1 # for the "press Enter" message CONT_MSG = '--- Press Enter ---' @@ -27,8 +28,8 @@ def reflow(text): for line in text.split('\n'): line = line.rstrip() while len(line) > 0: - out.append(line[0:TERM_COLS]) - line = line[TERM_COLS:] + out.append(line[0:REAL_TERM_COLS]) + line = line[REAL_TERM_COLS:] return out def print_paged(text): @@ -37,7 +38,6 @@ def print_paged(text): ll = len(lines) for i in range(0, ll, REAL_TERM_ROWS): chunk = lines[i:i + REAL_TERM_ROWS] - for line in chunk: print(line, end='') + for line in chunk: print(line) if i + REAL_TERM_ROWS < ll: input(CONT_MSG) - print()