diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-27 10:52:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | 6877a61ef40ad0d8e762a28d0a3f5fa9bfefaff2 (patch) | |
| tree | aabc3aa64afb2da01a67d8716cbd964743e679ed /src | |
| parent | c79612b523c1526202335302e1e49c078ca317cf (diff) | |
| download | pardes-6877a61ef40ad0d8e762a28d0a3f5fa9bfefaff2.tar.gz pardes-6877a61ef40ad0d8e762a28d0a3f5fa9bfefaff2.zip | |
an output pane is not a document: +Search/+Help split below the pane that asked, never into a column of their own
placeDoc classified any file pane as a doc, so a +Search opened from a lone
shell took layoutInsertColumn(0) - a whole new leftmost column, shoving every
existing column sideways - and an open results list was then eligible as the
split parent for a real file, stacking documents under the list. An output
buffer has no file behind it and no Save; it is the result list belonging to
the pane that asked for it. Now it is that on both sides of the rule: it
splits below from_id whatever kind of pane that is (a source that died falls
back to stackDocLeft, the same last resort a full column bar uses), and it is
skipped when a real doc hunts for its split parent, so a file opened from a
search row joins the docs instead of the results.
Real docs are untouched: fsearch/rsearch/look-file/tutor/lookpanes all pass
unchanged. psearch is the proof - its results snap was two columns (the shell
pushed to x=70, its gutter run at 70-71) and is now one 140-wide column with
the +Search stacked below at the same x origin.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pardes.zig | 19 | ||||
| -rw-r--r-- | src/tutor.txt | 12 |
2 files changed, 20 insertions, 11 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index d3376273..31757732 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4940,19 +4940,24 @@ pub const Pardes = struct { p.placeDoc(id, free, np); } - /// place a fresh doc pane. Any doc already open is the split parent (the + /// place a fresh doc pane. An OUTPUT buffer (+Search/+Help) is NOT a + /// document: it is the result list belonging to the pane that asked for it, + /// so it never claims a column and is never anyone else's split parent — it + /// lands right below `from_id`, be that a shell, a file or another list. + /// A real doc joins the docs: any doc already open is the split parent (the /// source if it IS one, else the first found) and the newcomer lands right /// below it, so all docs share one column. The FIRST doc of the session /// instead gets a column of its own on the left (acme: files left, shells - /// right) — nothing is displaced, the other columns just narrow. Only a - /// full column bar falls back to stacking into the leftmost one. + /// right) — nothing is displaced, the other columns just narrow. A full + /// column bar, or a result list whose source died, stacks into the leftmost. fn placeDoc(p: *Pardes, from_id: usize, free: usize, nt: *Pane) void { + const doc = if (nt.file) |f| !f.output else true; // an image is a doc var src_id: ?usize = null; - if (p.panes[from_id]) |src| if (src.file != null or src.image != null) { + if (p.panes[from_id]) |src| if (!doc or (if (src.file) |f| !f.output else src.image != null)) { src_id = from_id; }; - if (src_id == null) for (p.panes, 0..) |sl, i| { - if (sl) |pp| if ((pp.file != null or pp.image != null) and i != free) { + if (doc and src_id == null) for (p.panes, 0..) |sl, i| { + if (sl) |pp| if (i != free and (if (pp.file) |f| !f.output else pp.image != null)) { src_id = i; break; }; @@ -4965,7 +4970,7 @@ pub const Pardes = struct { p.active = free; return; } - if (p.ncol < MAX_COLS) { + if (doc and p.ncol < MAX_COLS) { p.layoutInsertColumn(0, free); p.active = free; return; diff --git a/src/tutor.txt b/src/tutor.txt index 195173c6..39a869e2 100644 --- a/src/tutor.txt +++ b/src/tutor.txt @@ -139,8 +139,11 @@ and case-insensitive, and writes one row per hit into a "+Search" pane. That is an OUTPUT BUFFER: a file pane with no file behind it, so it has no Save, but everything else about it is an ordinary buffer you can read, - edit, select and look in. `n`/`N` step the rows and look each one, so the - view follows along. Right-clicking a word that names no file in ANY open + edit, select and look in. It is not a document, though, and never takes a + column of its own: it opens BELOW the pane that asked for it, in that + pane's column, be that a file or a shell — and a file you then open from + its rows goes where files go, not under the list. `n`/`N` step the rows + and look each one, so the view follows along. Right-clicking a word that names no file in ANY open pane's directory searches for it — acme's button 3 — except in tty mode, where the click belongs to the program on the other end. On a shell with no search armed, n/N instead step the lookable tokens in its output. @@ -494,8 +497,9 @@ `?` works at ANY depth: SPC ? lists everything, SPC h ? lists only what the "h" group holds. Help writes into a "+Help" OUTPUT BUFFER, - the same kind of pane "/" search results land in — ordinary text, so - the names in it are live: middle-click "Tutor" there and it opens. + the same kind of pane "/" search results land in — so it opens below + the pane you asked from, never in a column of its own — and ordinary + text, so the names in it are live: middle-click "Tutor" and it opens. (No practice blocks: these run builtins, not text edits.) |
