From 54e83ebad8ae06d5fa8411e1ac907e1512c69ac8 Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 9 Jul 2026 15:19:48 +0200 Subject: search: land the cursor on the match's starting column _goto_line now sets cursor_x to the first match range's start on the target line (and _hscroll's it into view for the pseudocode view), so jumping to a search hit positions the cursor exactly on the match, not the old column. Search cancel/empty also restore the origin column. pilot suite 47/47. --- tests/test_tui.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/test_tui.py b/tests/test_tui.py index 9813c1f..688df57 100644 --- a/tests/test_tui.py +++ b/tests/test_tui.py @@ -171,6 +171,9 @@ async def run(db): check("cursor sits on a match", dis.cursor in dis._matches, f"cursor={dis.cursor}") check("match substring highlighted", bool(dis._ranges.get(dis.cursor)), str(dis._ranges.get(dis.cursor))) + check("search cursor lands on the match's starting column", + dis.cursor_x == dis._ranges[dis.cursor][0][0], + f"cursor_x={dis.cursor_x} ranges={dis._ranges.get(dis.cursor)}") prev = dis.cursor await pilot.press("slash") await pilot.pause(0.1) -- cgit v1.3.1-sl0p