From ddc2eefb1e7cdd402593efb1297c25fc7ae4b110 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 9 Jul 2026 15:41:28 -0300 Subject: small ui fixes --- src/pardes.zig | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.3