summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-24 13:11:11 -0300
committerGabriel Schneider <[email protected]>2026-10-24 13:27:54 -0300
commit9299281492d63e549ab274034efb59ab4e9d96f6 (patch)
tree326e55f07d422adf7fd4e9037107c22bfe70ae6e /src/exec.zig
parent1af098381515fbe3a4fe678cd023c7fd74418ae1 (diff)
downloadpardes-9299281492d63e549ab274034efb59ab4e9d96f6.tar.gz
pardes-9299281492d63e549ab274034efb59ab4e9d96f6.zip
Search converge 6/6: SearchPlace column, the finder column at the right edge holding the query panes; n/N in a frozen query pane; the design doc
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 2bc1a3e5..142dfef6 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -1197,6 +1197,14 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan
// No column left (the last one Delcol'd): a pane made from the workspace
// tag opens one to go in.
_ = layout.firstColumn(p);
+ // Anything asked from the finder column (a row looked at, a command
+ // there) goes where its query came from, never into the finder; and
+ // the rules that take the last column take the last that is not it.
+ const exec_column = p.exec_column;
+ defer p.exec_column = exec_column;
+ const away = p.finder.away(p, from, kind);
+ if (away) |c| p.exec_column = c;
+ const finder_column = p.finder.column(p);
const asked = if (p.exec_column != null) null else origin;
layout.compute(p);
const before = p.rects;
@@ -1206,9 +1214,10 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan
// (look.c:921-923, et->col).
.scratch => layout.acmePlace(p, p.exec_column orelse columnOf(p, from), null, id),
// +Errors, a command's output: the last column (util.c:94-98);
- // a command run from a column's tag, that column.
+ // a command run from a column's tag, that column. The finder's
+ // is never the last column for them.
.command => layout.acmePlace(p, p.exec_column orelse p.ncol - 1, null, id),
- .errors => layout.acmePlace(p, p.ncol - 1, null, id),
+ .errors => layout.acmePlace(p, away orelse p.ncol - 1, null, id),
// makenewwindow(nil) for 9P's new (acme.c:877), else (t).
.fs => layout.acmePlace(p, acmeColumn(p, from), null, id),
.shell, .doc => layout.acmePlace(p, acmeColumn(p, from), asked, id),
@@ -1238,7 +1247,7 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan
var c = p.ncol;
while (c > 0) {
c -= 1;
- if (c == f.col) continue;
+ if (c == f.col or c == finder_column) continue;
for (p.col_panes[c][0..p.col_n[c]]) |k| p.rects[k] = before[k];
layout.snapColWeights(p, c);
if (p.col_n[c] == 0) {