From a274bd2c706fdfd3effa0ad88c5b4083c0dc0f33 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:15:56 -0300 Subject: 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 --- src/ninep/ctl.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ninep/ctl.zig') 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" { -- cgit v1.3