diff options
Diffstat (limited to 'core/Messages.zig')
| -rw-r--r-- | core/Messages.zig | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/core/Messages.zig b/core/Messages.zig index 725f5a99..b89b9676 100644 --- a/core/Messages.zig +++ b/core/Messages.zig @@ -689,7 +689,7 @@ pub const Row = struct { /// pitch (Layer.capacity) is cut to it. pub const notice_row_cap = 1024; -pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row { +pub fn noticeRow(p: *Pardes, width: usize, out: *[notice_row_cap]u8) Row { const m = &p.messages; const tab = p.settings.tab; // A rolled level's last leaf, while the level shows: what it does, the @@ -708,10 +708,16 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row { live += 1; if (s.kind == .question) questions += 1; } - // While a picker previews, its sentence (UX D7), before any message. + // While a picker previews, its sentence (UX D7), before any message; + // while a band shows with no room for its doc, the doc's first line + // (UX D5's give-way). const said = pardes.Pick.sentence(p, &w); - const lead = if (said == null) m.headline() else null; - if (said != null) {} else if (lead) |s| { + var doc_buf: [notice_row_cap]u8 = undefined; + const doc = if (said == null) pardes.Band.docLeft(p, &doc_buf) else null; + const lead = if (said == null and doc == null) m.headline() else null; + if (said != null) {} else if (doc) |line| { + w.writeAll(line) catch {}; + } else if (lead) |s| { w.print("{s} ", .{s.kind.glyph()}) catch {}; // Its cause first, unless its words name it already. const words = s.words(); @@ -744,7 +750,7 @@ pub fn noticeRow(p: *const Pardes, width: usize, out: *[notice_row_cap]u8) Row { const room = width -| (if (tail_w > 0) tail_w + 2 else 0); var cut = left_end; if (panes.File.displayWidth(tab, out[0..cut]) > room) { - if (said == null and lead == null) { + if (said == null and doc == null and lead == null) { var from: usize = 0; while (from < left_end and panes.File.displayWidth(tab, out[from..left_end]) > room -| 1) { from += 1; |
