scroll-window remote control command: Fix a regression that broke scrolling by pages

Fixes #10253
This commit is contained in:
Kovid Goyal
2026-07-12 09:59:34 +05:30
parent f935258394
commit 368753682d
2 changed files with 4 additions and 1 deletions

View File

@@ -224,6 +224,8 @@ Detailed list of changes
- :opt:`cursor_trail_start_threshold` now optionally accepts two values to set x (horizontal) and y (vertical) thresholds independently (:iss:`10246`)
- scroll-window remote control command: Fix a regression that broke scrolling by pages (:iss:`10253`)
0.47.4 [2026-06-15]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -76,13 +76,14 @@ using this option means that you will not be notified of failures.
case 'l':
window.scroll_fractional_lines(amt)
case 'p':
unit = 'page'
if not isinstance(amt, int) and not amt.is_integer():
amt = round(window.screen.lines * amt)
unit = 'line'
assert isinstance(amt, int)
direction = 'up' if amt < 0 else 'down'
func = getattr(window, f'scroll_{unit}_{direction}')
for i in range(int(abs(amt))):
for _ in range(int(abs(amt))):
func()
return None