summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 12:37:56 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commit2bd2ae838cd7db2ef5cde9038be50680a59cab97 (patch)
tree19d34193fbdc07994d019d7ca42feffd9338b7fc /src/ninep
parent18eeb7e628c1bbfc6ec0e92c0b327f384f549509 (diff)
downloadpardes-2bd2ae838cd7db2ef5cde9038be50680a59cab97.tar.gz
pardes-2bd2ae838cd7db2ef5cde9038be50680a59cab97.zip
Symbols, Diagnostics and every language server list share their directory's one +Search
Only Find and Grep reused the directory's +Search; a language server's list made another pane of the same name each time. Every origin named +Search now shares it, but a plain word's search, which keeps a list a pattern for n/N to walk between. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index b79b1ab8..0d3f084d 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2161,6 +2161,21 @@ test "a PDF's body reads its page's text layer, and takes no write" {
try testing.expectEqual(E.INVAL, wr(p, body, "more\n").errno());
}
+test "Grep, Symbols and Diagnostics share their directory's one +Search" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const id = p.active;
+ const Output = pardes.panes.Output;
+ try Output.fillResults(p, id, "/tmp", .{ .cmd = .Grep }, "x", try p.gpa.dupe(u8, "a.txt:1:1 x\n"), null);
+ try Output.fillResults(p, id, "/tmp", .{ .query = .document_symbols }, "", try p.gpa.dupe(u8, "a.txt:2:1 fn f\n"), null);
+ try Output.fillResults(p, id, "/tmp", .{ .query = .diagnostics }, "", try p.gpa.dupe(u8, "a.txt:3:1 error\n"), null);
+ var searches: usize = 0;
+ for (p.panes) |slot| if (slot) |q| if (q.file) |f| if (f.output != null) {
+ searches += @intFromBool(std.mem.eql(u8, f.path, "/tmp/+Search"));
+ };
+ try testing.expectEqual(@as(usize, 1), searches);
+}
+
test "every EINVAL a write gets says why, in its err record too; DEL is a control character in a line" {
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();