From fcfdc8c941aeb87cc99c983146f553e03a5daa49 Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 6 Aug 2026 15:11:54 +0200 Subject: rpc: an opfmt verb, and 'drive fmt' mode is cycle/back/show or an explicit format. 'show' reports the current format and the stops on offer without editing, which is what a driver needs: the rendered text alone can't be trusted (a listing read before an ARM/Thumb switch shows the old decoding). 'word' puts the cursor on a token first, so a literal can be named instead of steered to. --- docs/RPC.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/RPC.md b/docs/RPC.md index 53ec36b..83c65fe 100644 --- a/docs/RPC.md +++ b/docs/RPC.md @@ -87,6 +87,7 @@ predicate so the returned state is final. | `back` | — | Escape: pop the nav stack. | | `toggle_view` | — | Tab: disasm ⇄ pseudocode. | | `hex` | — | `\`: hex view. | +| `graph` | `action?=show`, `target?`, `blocks?` | the control-flow graph (Space). `show` is a pure read — blocks, typed edges, ranks, box geometry and the cursor, **not** the box-drawing characters; `screen` gives you the drawing. `open`/`close`/`toggle` switch mode, `zoom` cycles full→compact→collapsed, `entry` jumps to the entry block, `succ`/`pred` follow one edge (`J`/`K`), `block target=` puts the cursor in a block. `blocks=false` omits the per-block list. See `docs/GRAPH_VIEW.md`. | | `xrefs` | — | `x`: open the xref picker. | | `symbols` | `query?` | Ctrl+N palette, optionally pre-typed. | | `structs` | — | Ctrl+T struct editor. | @@ -109,9 +110,16 @@ prompt round-trips, i.e. tens of minutes for a few hundred symbols, where | method | params | effect | |--------|--------|--------| | `move` | `dir`, `n?=1`, `settle?` | `dir` ∈ down/up/left/right/word/wordback/bol/eol/top/bottom/halfdown/halfup/pagedown/pageup. | -| `cursor` | `line?`, `col?` | set the cursor directly on the active code pane (disasm/decomp). | +| `cursor` | `line?`, `col?` | set the cursor directly on the active code pane (disasm/decomp), scrolling it into view. | | `cursor_on` | `word`, `line?`, `occurrence?=1` | place the cursor on the *n*-th token equal to `word` (verified with the app's tokenizer). Decomp searches the whole body; disasm only cached/visible lines. Returns `{found, ...state}`. | +**Both cursor verbs scroll to what they selected, and `cursor_on` searches from +the viewport** (wrapping round to the rows above). A continuous listing is the +whole segment: counting occurrences from row 0 used to land the cursor in an +unrelated function thousands of rows away, off screen, and the next edit then +happened somewhere the operator could not see — with the driver reporting +success. If you mean a specific occurrence far away, pass `line=`. + ## Driving pattern for an agent Compose raw + semantic + introspection: e.g. `goto target=` → `state`/`view` -- cgit v1.3.1-sl0p