summaryrefslogtreecommitdiff
path: root/src/Stream.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:43:45 -0300
committerGabriel Schneider <[email protected]>2026-11-04 23:48:44 -0300
commit55492ffa53d7df11a38c6639f8fde6cdc87800c7 (patch)
treed6515b6a0dbcac62c305c999ad5865943b4c466a /src/Stream.zig
parent5a927d1a4e92750bc0d48994df2c2e552d669b01 (diff)
downloadpardes-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/Stream.zig')
-rw-r--r--src/Stream.zig4
1 files changed, 3 insertions, 1 deletions
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;