summaryrefslogtreecommitdiff
path: root/src/Output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 11:17:56 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitab4bdfb9cbe2ee32889ad7b675dab1f5bfeae707 (patch)
treeb2b39529f76c33c26bdcd516ef90ca242922589c /src/Output.zig
parentbe11a4e58e86d9b299accd3688c89d3c3a7b4b0c (diff)
downloadpardes-ab4bdfb9cbe2ee32889ad7b675dab1f5bfeae707.tar.gz
pardes-ab4bdfb9cbe2ee32889ad7b675dab1f5bfeae707.zip
A directory's +Search is found by its directory, the pane that ran the search included
Find and Grep passed over the pane they ran in when looking for the +Search to fill, so a Grep written to a +Search's own exec made a second one, and the two swapped roles on each run after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Output.zig')
-rw-r--r--src/Output.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Output.zig b/src/Output.zig
index e6d6f46c..495dbc43 100644
--- a/src/Output.zig
+++ b/src/Output.zig
@@ -436,7 +436,9 @@ pub fn fillResults(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []
const by_arg = std.meta.activeTag(from) != .query;
if (p.locations_config.context == 0 and !p.locations_config.tscontext) {
for (p.panes, 0..) |slot, i| {
- if (i == id) continue;
+ // A directory's +Search is found by its directory, whatever
+ // pane ran the search: that +Search itself too.
+ if (i == id and !fileSearch(from)) continue;
const rp = slot orelse continue;
const rf = if (rp.file) |*f| f else continue;
const output = if (rf.output) |*o| o else continue;
@@ -463,11 +465,11 @@ pub fn fillResults(p: *Pardes, id: usize, dir: []const u8, from: Origin, arg: []
anchor = formatted.anchor;
}
for (p.panes, 0..) |slot, i| {
- if (i == id) continue;
const rp = slot orelse continue;
const rf = if (rp.file) |*f| f else continue;
const o = if (rf.output) |*x| x else continue;
const shared = fileSearch(from) and fileSearch(o.from);
+ if (i == id and !shared) continue;
if (!shared and !std.meta.eql(o.from, from)) continue;
if (!shared and by_arg and !std.mem.eql(u8, o.arg(), arg)) continue;
if (!std.mem.eql(u8, std.fs.path.dirname(rf.path) orelse "", dir)) continue;