diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-24 09:49:23 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | a3ebcd08f9fb44d5e69ddafae238f83905ff5ba4 (patch) | |
| tree | 8dc24727e13dd9cb34bec6c3af0dd2434d39c58d /src/panes.zig | |
| parent | a39fb20cb770c3adb911cec7d1f3d033669ed1bb (diff) | |
| download | pardes-a3ebcd08f9fb44d5e69ddafae238f83905ff5ba4.tar.gz pardes-a3ebcd08f9fb44d5e69ddafae238f83905ff5ba4.zip | |
Paint a prompt on its notice band, not on the body grid
A builtin that asks for input (Save's path, a search, a pipe) shows its
prompt as a notice chip, like Msg output and the leader chord. Messages and
the chord went through a tag layer, which is what gives a chip the tagline's
height, pitch and band offset; the prompt alone stayed on the grid so its
caret could sit on a cell. A pixel shell therefore drew its tagline glyphs
one to a BODY cell, spaced out like a banner, while the chips around it were
set tight.
The prompt is now a band like the others and carries its caret on the layer,
at the same place in the text the grid pass puts it. The grid still paints
it, for terminal clients. What a band says comes from one place,
noticeText, which the grid pass and the layer pass both read, and what a
prompt says from one place, Pane.promptText, which collectNotices, the
painters and submitSearch share.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Diffstat (limited to 'src/panes.zig')
| -rw-r--r-- | src/panes.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/panes.zig b/src/panes.zig index 8d4330e9..0b565676 100644 --- a/src/panes.zig +++ b/src/panes.zig @@ -344,6 +344,13 @@ pub const Pane = struct { }; } + /// What an open prompt shows on its notice band: the one answer every + /// painter of the band reads. + pub fn promptText(p: *const Pane) ?[]const u8 { + const at = p.promptAt() orelse return null; + return p.tagSlice()[@min(at, p.tag_tail_len)..]; + } + pub fn appendTag(p: *Pane, text: []const u8) bool { if (text.len > p.tag_tail.len - p.tag_tail_len) return false; @memcpy(p.tag_tail[p.tag_tail_len..][0..text.len], text); |
