diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 08:15:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 08:53:11 -0300 |
| commit | a274bd2c706fdfd3effa0ad88c5b4083c0dc0f33 (patch) | |
| tree | 1242a9341c5692e58890706a65bc89f6ad2e3633 /src/ninep/ctl.zig | |
| parent | 577108ec6a003db9504b8376f3d88c21ccaf0765 (diff) | |
| download | pardes-a274bd2c706fdfd3effa0ad88c5b4083c0dc0f33.tar.gz pardes-a274bd2c706fdfd3effa0ad88c5b4083c0dc0f33.zip | |
Grep and Find say when a cap hid what they might have found: `cut at 512 hits`, `N files read only in part (first 256 KiB)`, `walk cut at N entries`; one that finds nothing leaves the +Search as it was
Grep reads 256 KiB of a file and stops at 512 hits, and its walk at
20000 files or 100000 entries; Find stops at 512 names. A cap hit was
silent, so a match past one read as `pattern not found`. The walk now
notes each cap it hit (fs.WalkNotes) and the +Search says it in a line
under the hits, as it says directories skipped; a search that found
nothing but hit a cap opens the +Search with those lines, not a miss.
A Find or Grep that finds nothing and passed nothing over leaves the
directory's +Search with the last search's rows, its failure saying so,
where it used to empty it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
| -rw-r--r-- | src/ninep/ctl.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index c564da6e..d4f36bea 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -2563,8 +2563,9 @@ test "Grep with no hit says grep: no match and opens nothing, a missing pane dir var after: usize = 0; for (p.panes) |slot| after += @intFromBool(slot != null); try testing.expectEqual(count, after); - // The +Search the miss would have filled is emptied, not left stale. - try testing.expectEqualStrings("", found.file.?.content); + // The +Search a miss would have filled keeps the last search's rows: + // the miss is said, and its tag names what they are of. + try testing.expect(std.mem.indexOf(u8, found.file.?.content, "bravo here") != null); } test "Unmount of a name not mounted says no such mount, which a mount reads as ENOENT" { |
