diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-24 12:43:02 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-24 13:11:11 -0300 |
| commit | 1af098381515fbe3a4fe678cd023c7fd74418ae1 (patch) | |
| tree | 34f8f1495ddbea9542d23af68db53f244a1ec4c5 /src/normal.zig | |
| parent | 8ac6db5662dd2db0f082e1651835f1db36e235f8 (diff) | |
| download | pardes-1af098381515fbe3a4fe678cd023c7fd74418ae1.tar.gz pardes-1af098381515fbe3a4fe678cd023c7fd74418ae1.zip | |
Search converge 5/6: the old search pipeline phased out, the notice-band / for texts, Find/Grep prompts and walks on the loop, +Recent, n/N as Look-the-next-row; docs, tutor, Help and goldens to the query pane
Diffstat (limited to 'src/normal.zig')
| -rw-r--r-- | src/normal.zig | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/normal.zig b/src/normal.zig index ebace536..f5bdb9dc 100644 --- a/src/normal.zig +++ b/src/normal.zig @@ -757,22 +757,18 @@ fn executeNormalAction(p: *Pardes, t: *Text, semantic: modal.Normal.Action) void .add_newline => |newline| return edit.addNewline(p, t, newline.direction == .forward, newline.count), .diagnostic => |diagnostic| { const fwd = diagnostic.direction == .forward; - if (!diagnostic.endpoint) { - if (panes.Output.resultsFrom(p, pane, .{ .query = .diagnostics }) and - look.searchStep(p, p.active, if (fwd) 1 else -1)) return; - return p.lspRequest(p.active, .diagnostics, ""); - } - if (!panes.Output.resultsFrom(p, pane, .{ .query = .diagnostics })) - return p.lspRequest(p.active, .diagnostics, ""); - if (!fwd) { - pane.search_row = null; - _ = look.searchStep(p, p.active, 1); - return; - } - const rp = p.panes[pane.search_pane orelse return] orelse return; - const rf = rp.file orelse return; - pane.search_row = std.mem.count(u8, rf.content, "\n"); - _ = look.searchStep(p, p.active, -1); + // Once a Diagnostics query fed them, the diagnostics are this + // text's places: ]d and [d step them as n and N do, ]D and [D + // go to the last and the first. Until then, asked for. + const set = &pane.places; + const fed = set.started and set.provenance == .list and if (p.paneBySerial(set.from)) |qid| + (if (p.panes[qid].?.query) |q| q.source == .diagnostics else false) + else + false; + if (!fed) return p.lspRequest(p.active, .diagnostics, ""); + if (!diagnostic.endpoint) return set.step(p, pane, fwd, 1, false); + if (set.hits.items.len == 0) return; + set.goTo(pane, if (fwd) set.hits.items.len - 1 else 0, false); }, .move => |move| switch (move.motion) { .left => { |
