diff options
| author | blasty <blasty@local> | 2026-07-09 15:25:02 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-09 15:25:02 +0200 |
| commit | e3636217535a5ff93f9b448cb1998ed010bfbbba (patch) | |
| tree | f0654dc2d657711ac0f2cbfe36eae1cb4ed6f82b /tests | |
| parent | search: land the cursor on the match's starting column (diff) | |
| download | ida-tui-e3636217535a5ff93f9b448cb1998ed010bfbbba.tar.gz ida-tui-e3636217535a5ff93f9b448cb1998ed010bfbbba.tar.xz ida-tui-e3636217535a5ff93f9b448cb1998ed010bfbbba.zip | |
paging: preserve the cursor's viewport-relative row (IDA-style)
PageUp/Down and Ctrl+U/D now move the scroll top and the cursor by the same
(clamped) delta, so the cursor keeps its relative screen row instead of snapping
to an edge; at the very top/bottom the cursor jumps to the extreme. Shared
_page_scroll in ColumnCursor, used by both views. pilot suite 49/49.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_tui.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_tui.py b/tests/test_tui.py index 688df57..47c5a67 100644 --- a/tests/test_tui.py +++ b/tests/test_tui.py @@ -501,6 +501,27 @@ async def run(db): round(dis.scroll_offset.y) == want_sy and dis.cursor == want_cur, f"scroll={round(dis.scroll_offset.y)} (want {want_sy}) cursor={dis.cursor}") + # PageUp/Down keep the cursor at the same viewport-relative row. + await goto_name(fa.name) + await wait_until(pilot, lambda: dis.total > 100 and app._cur.ea == fa.addr, timeout=20) + if app._active != "disasm": + await pilot.press("tab") + await pilot.pause(0.2) + for _ in range(6): + await pilot.press("j") + await pilot.pause(0.1) + rel = dis.cursor - round(dis.scroll_offset.y) + await pilot.press("pagedown") + await pilot.pause(0.1) + check("PageDown preserves the viewport-relative row", + dis.cursor - round(dis.scroll_offset.y) == rel, + f"rel={dis.cursor - round(dis.scroll_offset.y)} want={rel}") + await pilot.press("pageup") + await pilot.pause(0.1) + check("PageUp preserves the viewport-relative row", + dis.cursor - round(dis.scroll_offset.y) == rel, + f"rel={dis.cursor - round(dis.scroll_offset.y)} want={rel}") + def main(argv): db = None |
