diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-09 15:41:28 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | ddc2eefb1e7cdd402593efb1297c25fc7ae4b110 (patch) | |
| tree | fd56641c114ff18719088aea0f27ce29b7721241 /src | |
| parent | f948213755d6cc1920be1794149644108c6a3f30 (diff) | |
| download | pardes-ddc2eefb1e7cdd402593efb1297c25fc7ae4b110.tar.gz pardes-ddc2eefb1e7cdd402593efb1297c25fc7ae4b110.zip | |
small ui fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/pardes.zig | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index cae3a0ab..16193967 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -4446,9 +4446,21 @@ pub const Pardes = struct { } } - /// place a fresh doc pane: split an existing doc (the source if it's one, - /// else the first found), or take the left column when no doc exists yet + /// place a fresh doc pane. With a single column there is no separate file + /// column, so split BELOW the pane the look came from — the same acme split + /// as a dir open (splitParent picks a taller pane if the source is too + /// short). With two+ columns, open in the file column: split an existing + /// doc (the source if it's one, else the first found), or take the left + /// column when no doc exists yet. fn placeDoc(p: *Pardes, from_id: usize, free: usize, nt: *Pane) void { + if (p.ncol == 1) { + const src = p.splitParent(from_id); + const f = p.layoutFindTerm(src).?; + p.layoutInsert(f.col, f.idx + 1, free); + p.splitBelow(src, nt); + p.active = free; + return; + } var src_id: ?usize = null; if (p.panes[from_id]) |src| if (src.file != null or src.image != null) { src_id = from_id; |
