summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 08:26:42 -0300
committerGabriel Schneider <[email protected]>2026-10-01 08:53:11 -0300
commitb7eb31674e01c992cafc91518e161258b921bd33 (patch)
treea55a358f2753b470ffdad261c8dd375aea6a069b /src/ninep
parentf3070c04d3eaa0e0d3965478781c2d0b456446bf (diff)
downloadpardes-b7eb31674e01c992cafc91518e161258b921bd33.tar.gz
pardes-b7eb31674e01c992cafc91518e161258b921bd33.zip
A pane's ctl read says Collapse and a PDF's PdfFit and PdfTint (`collapsed`, `fit:height tint:full`), and a Dump keeps the PDF's two
Neither showed in the tag or the ctl, and a Restore brought a PDF back at width fit and the default tint. The ctl read ends with `collapsed` when it is, and a PDF's `fit:` and `tint:` in the words PdfFit and PdfTint take; the dump's image record carries pdf_fit and pdf_tint (empty in older dumps: the defaults). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index c5e47d5d..6c9ee2da 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -382,7 +382,7 @@ fn writeQuoted(w: *std.Io.Writer, s: []const u8) !void {
try w.writeByte('\'');
}
-pub const pane_text_cap = 9 * 12 + 2 * 256 + 4 + "notcurrent ".len + 48;
+pub const pane_text_cap = 9 * 12 + 2 * 256 + 4 + "notcurrent ".len + 48 + "collapsed fit:height tint:filtered ".len;
/// acme's winctlprint (plan9port wind.c), field for field: serial, tag
/// length, body length, isdir (0), the dirty flag, the width in cells, the
@@ -412,6 +412,10 @@ pub fn paneText(p: *Pardes, pane: *Pane, buf: []u8) []const u8 {
var idbuf: [48]u8 = undefined;
const id = exec_line.replId(&idbuf, pane);
if (id.len > 0) w.print("{s} ", .{id}) catch {};
+ // Then what its tag does not say: Collapse, and a PDF's PdfFit and
+ // PdfTint, in the words they take.
+ if (pane.collapsed) w.writeAll("collapsed ") catch {};
+ if (comptime pardes.pdf_enabled) if (pane.pdf) |pv| w.print("fit:{s} tint:{s} ", .{ @tagName(pv.fit), @tagName(pv.tint) }) catch {};
return w.buffered();
}
@@ -4309,3 +4313,13 @@ test "Lspinfo's answer is the +Lsp pane it fills, as a Rename preview's is its +
const shown = p.paneBySerial(p.fs.lsp_result.?).?;
try testing.expect(std.mem.endsWith(u8, p.panes[shown].?.file.?.path, "+Lsp"));
}
+
+test "a collapsed pane's ctl says so" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ _ = try th.newPane(p);
+ const id = p.paneBySerial(serialOf(p)).?;
+ layout.toggleCollapse(p, id);
+ try testing.expect(p.panes[id].?.collapsed);
+ try testing.expect(std.mem.endsWith(u8, rd(p, Node.of(serialOf(p), .ctl), 0, 4096).bytes, " collapsed "));
+}