summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig31
1 files changed, 22 insertions, 9 deletions
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();
}