From 2d6541a93992790b7013feb3b0756c381f2c8fa6 Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 24 Jul 2026 22:10:25 +0200 Subject: split-view phase 2: cursor sync + linked-row highlight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Ghidra sync: in split, the focused pane drives and the companion shows a subtle band (_S_LINK) on the linked location + scrolls it into view. The companion's cursor never moves (band + scroll only), so there's no echo/ ping-pong and no guard is needed. * _sync_split(source): listing drives -> DecompView.line_for_ea (largest /*ea*/ marker <= cursor ea) bands the covering C line; decomp drives -> ListingModel.ensure_ea bands the covering instruction row. * wired into on_listing/decomp_view_cursor_moved (gated on the focused pane), the Tab focus-switch (re-link from the new driver), _apply_decomp (link once the pseudocode loads) and _apply_enter_split; bands cleared on leaving split. * ListingView/DecompView gain _link_rows/_link_line + set_link/reveal, a render_line apply_style(_S_LINK) band, and DecompView.line_for_ea. Still single-ea per line (one instruction highlighted) — the full instruction range is phase 3 (the decomp_map tool). Pilot split_view now covers both sync directions + that the band actually paints (10/10); full suite 151/2-flake. --- docs/SPLIT_VIEW.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/SPLIT_VIEW.md b/docs/SPLIT_VIEW.md index e68528f..740ae90 100644 --- a/docs/SPLIT_VIEW.md +++ b/docs/SPLIT_VIEW.md @@ -70,9 +70,13 @@ Entering split loads listing + decomp for the current function; exiting returns the focused pane. `Tab` in split switches the focused pane (single-view `Tab` still toggles disasm/pseudocode). No new tools. *← this doc's current target.* -**Phase 2 — crude sync (MVP).** Wire both `cursor_moved` handlers using the -existing single-ea map + `_decomp_line_for`. Subtle linked-row highlight -(`_S_LINK`) + scroll-follow. Feels like Ghidra for most lines. No new tools. +**Phase 2 — crude sync (MVP). DONE.** Both `cursor_moved` handlers wired via +`_sync_split`: the focused pane drives; the companion gets a subtle `_S_LINK` +band + scroll-into-view (its cursor never moves, so there's no echo — no guard +needed). listing→decomp uses `DecompView.line_for_ea` (largest marker ≤ ea); +decomp→listing uses `ListingModel.ensure_ea`. Tab re-links from the new driver. +Still single-ea per line (one instruction highlighted); the region comes in +phase 3. **Phase 3 — rich highlight.** `decomp_map` custom tool (line → ea-set) stored on `Decompilation`; highlight the whole instruction range of a C line; tighten the -- cgit v1.3.1-sl0p