From 1af098381515fbe3a4fe678cd023c7fd74418ae1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 24 Oct 2026 12:43:02 -0300 Subject: 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 --- src/Output.zig | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/Output.zig') diff --git a/src/Output.zig b/src/Output.zig index 1e62b04a..01e3e0f1 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -857,15 +857,6 @@ pub fn dropUnsaved(p: *Pardes, gone: *const Pane) void { } } -/// Recent: the one +Recent, filled again when it is there (as Find and -/// Grep's +Search is), else opened below the asking pane. -pub fn openRecent(p: *Pardes, id: usize) !void { - var out: std.Io.Writer.Allocating = .init(p.gpa); - errdefer out.deinit(); - try recentText(p, &out.writer, true); - try refillOrOpen(p, id, .{ .cmd = .Recent }, try out.toOwnedSlice()); -} - /// The one stepped output from `from`, filled again with `content` when it /// is there (Recent, Jumplist), or opened when it is not. fn refillOrOpen(p: *Pardes, id: usize, from: Origin, content: []u8) !void { @@ -971,6 +962,28 @@ fn helpContent(gpa: std.mem.Allocator, prefix: []const u8) ![]u8 { } if (show_calls_help) try w.writeAll(calls_help); if (prefix.len == 0) try w.writeAll(language_footer); + // The paths that run a builtin with a word (config.leader_args), and how + // a query pane is driven: under SPC f, b, s and in the whole listing. + const search_group = for (config.leader_args) |la| { + if (std.mem.startsWith(u8, la.path, prefix)) break true; + } else std.mem.eql(u8, prefix, "f"); + if (prefix.len == 0 or search_group) { + try w.writeAll("\nsearch: a query pane under the text,\nits line 1 the query, its first word\nthe source (/ Find Grep Recent Panes\nSymbols All Refs Def Impl Diagnostics)\n"); + for (config.leader_args) |la| { + if (!std.mem.startsWith(u8, la.path, prefix)) continue; + var keys: [16]u8 = @splat(' '); + for (la.path, 0..) |c, i| keys[2 * i] = c; + try w.print("{s} {s} {s}\n", .{ keys[0..8], @tagName(la.cmd), la.arg }); + } + if (prefix.len == 0) try w.writeAll( + "/ * the text (* seeds it)\n" ++ + "C-n C-p Up Down step, typing on line 1\n" ++ + "n N step the text's places\n" ++ + "Enter land there, keep the rows\n" ++ + "Esc put every view back\n" ++ + "More a Grep past 2000 lines\n", + ); + } return out.toOwnedSlice(); } -- cgit v1.3