From 9299281492d63e549ab274034efb59ab4e9d96f6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 24 Oct 2026 13:11:11 -0300 Subject: 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 --- src/exec.zig | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/exec.zig') 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) { -- cgit v1.3