summaryrefslogtreecommitdiff
path: root/src/Output.zig
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/Output.zig
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/Output.zig')
-rw-r--r--src/Output.zig9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Output.zig b/src/Output.zig
index 1461757f..f2ab1bda 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -428,11 +428,12 @@ pub fn hasFileSearch(p: *Pardes, dir: []const u8) bool {
return false;
}
+/// Whether `from` fills its directory's one +Search, whatever filled it
+/// last (Find, Grep, Symbols, Diagnostics, any language server's list),
+/// each run replacing the last. A plain word's search (in a file or a PDF)
+/// keeps a +Search a pattern: n/N walk from one such list to the next.
fn fileSearch(from: Origin) bool {
- return switch (from) {
- .cmd => |c| c == .Find or c == .Grep,
- else => false,
- };
+ return from != .search and std.mem.eql(u8, traits(from).name, config.search_buffer);
}
pub fn fillResults(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []const u8, content: []u8, initial_anchor: ?usize) !void {