summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 11:18:33 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit23ff1aa588c5dfcb194543c949ebd87cbb12e725 (patch)
tree559edacde2bce8000c0d89bcc220cdaf47680684 /src/ninep
parentab4bdfb9cbe2ee32889ad7b675dab1f5bfeae707 (diff)
downloadpardes-23ff1aa588c5dfcb194543c949ebd87cbb12e725.tar.gz
pardes-23ff1aa588c5dfcb194543c949ebd87cbb12e725.zip
A repeated identical search reads back the +Search it left as it was
When a Find or Grep found exactly what its +Search already held, the pane was kept but not marked as the one the search touched, so the exec read back the pane it ran in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 40a1a7cd..2dc3a51b 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1860,6 +1860,9 @@ test "Grep with no hit says grep: no match and opens nothing, a missing pane dir
try testing.expect(std.mem.indexOf(u8, found.file.?.content, "other.txt") != null);
try testing.expectEqual(grepped.serial, found.serial);
try testing.expect(std.mem.indexOf(u8, found.file.?.content, "bravo here") == null);
+ // The same Find again reads back the +Search, not the pane it ran in.
+ try testing.expectEqual(Status.ok, wr(p, Node.of(serialOf(p), .exec), "Find other\n").reply.status);
+ try testing.expectEqualStrings(try std.fmt.bufPrint(&line, "{d}\n", .{found.serial}), rd(p, root_exec, 0, 64).bytes);
// A Grep run from the +Search itself fills that one, never a second.
try testing.expectEqual(Status.ok, wr(p, Node.of(found.serial, .exec), "Grep bravo\n").reply.status);
try testing.expectEqualStrings(try std.fmt.bufPrint(&line, "{d}\n", .{found.serial}), rd(p, root_exec, 0, 64).bytes);