From 55492ffa53d7df11a38c6639f8fde6cdc87800c7 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:43:45 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/Stream.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Stream.zig') diff --git a/src/Stream.zig b/src/Stream.zig index 8e51b797..1e6abbc5 100644 --- a/src/Stream.zig +++ b/src/Stream.zig @@ -44,6 +44,8 @@ const batch_ns = 16 * std.time.ns_per_ms; const batch_bytes = 256 * 1024; /// A bigger file is not searched. const max_file_bytes = 16 << 20; +/// The walk goes no deeper than this many directories below its root. +const max_walk_depth = 16; /// What a worker sends: rows as fs.zig wrote them (`path:line:col-end /// text`, a listing's `path`), relative to the search's directory. Owned by @@ -883,7 +885,7 @@ const Worker = struct { const path = if (prefix.len == 0) e.name else try std.fmt.allocPrint(a, "{s}/{s}", .{ prefix, e.name }); switch (e.kind) { .directory => { - if (depth + 1 >= filesystem.WalkNotes.max_depth or e.name[0] == '.') continue; + if (depth + 1 >= max_walk_depth or e.name[0] == '.') continue; if (for (filesystem.find_skip) |skip| { if (std.mem.eql(u8, e.name, skip)) break true; } else false) continue; -- cgit v1.3