diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:43:45 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 23:48:44 -0300 |
| commit | 55492ffa53d7df11a38c6639f8fde6cdc87800c7 (patch) | |
| tree | d6515b6a0dbcac62c305c999ad5865943b4c466a /src/fs.zig | |
| parent | 5a927d1a4e92750bc0d48994df2c2e552d669b01 (diff) | |
| download | pardes-55492ffa53d7df11a38c6639f8fde6cdc87800c7.tar.gz pardes-55492ffa53d7df11a38c6639f8fde6cdc87800c7.zip | |
Find, Grep: their output traits, Output's sort of a Find's whole filenames above its walk notes, and fs.WalkNotes go, as both search on the disk engine (Stream.zig, which keeps the walk's depth as max_walk_depth) and nothing makes a .cmd = .Find or .Grep pane; the tests that filled one fill a .search or query pane (ctl.zig's is now "workspace symbols, Symbols and Diagnostics share their directory's one +Search"), and the Find sort test keeps its half on next location ("next location uses numeric columns")
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/fs.zig')
| -rw-r--r-- | src/fs.zig | 36 |
1 files changed, 0 insertions, 36 deletions
@@ -1104,42 +1104,6 @@ pub const platform_has_fs = !pardes.isolated and switch (pardes.platform) { const find_max_hits = 512; -/// What a Find or Grep walk passed over, said under its hits: directories -/// it might not open, and caps it stopped at. -pub const WalkNotes = struct { - skipped: usize = 0, - hits_cut: bool = false, - /// A pane search's matching lines it stopped at, its rows filling - /// look.search_text_output_bytes; 0 if none. - rows_cut: usize = 0, - /// The cap on entries walked it stopped at, 0 if none. - walk_cut: usize = 0, - - pub const max_hits = find_max_hits; - pub const max_files = grep_max_files; - pub const max_depth = find_max_depth; - - /// The lines that say it, each ending in a newline, into `out`. - pub fn write(n: WalkNotes, out: []u8) usize { - var w = std.Io.Writer.fixed(out); - if (n.hits_cut) w.print("cut at {d} hits\n", .{max_hits}) catch {}; - if (n.rows_cut > 0) w.print("cut at {d} lines\n", .{n.rows_cut}) catch {}; - if (n.walk_cut > 0) w.print("walk cut at {d} entries\n", .{n.walk_cut}) catch {}; - if (n.skipped > 0) w.print("{d} director{s} skipped: permission denied\n", .{ n.skipped, if (n.skipped == 1) "y" else "ies" }) catch {}; - return w.buffered().len; - } - - /// Whether `line` is one of those, not a hit. - pub fn isNote(line: []const u8) bool { - if (std.mem.startsWith(u8, line, "cut at ") or std.mem.startsWith(u8, line, "walk cut at ")) return true; - const digits = for (line, 0..) |c, i| { - if (!std.ascii.isDigit(c)) break i; - } else line.len; - if (digits == 0) return false; - const rest = line[digits..]; - return std.mem.startsWith(u8, rest, " director") or std.mem.startsWith(u8, rest, " file"); - } -}; const find_max_depth = 16; pub const find_skip = [_][]const u8{ |
