summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 8b3d44d0..bb1a1273 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -202,6 +202,36 @@ pub const Restore = struct {
}
};
+// ---- the message row ----
+
+/// TEXT onto this pane's transient message row — the row a failed save, a
+/// refused Look and a language server that would not start all report through
+/// (Pardes.setMessage, and Pardes.reportError one line above it). Every writer
+/// of that row is something going wrong, so until this word there was no way
+/// to look at it without breaking something on purpose: no wording could be
+/// checked against a narrow pane, and no test could pin the row without
+/// arranging a real failure first.
+///
+/// Bare, it reports ITSELF through the error path, because that is the other
+/// half of the same machinery — `reportError` is `setMessage` plus an
+/// `<operation>: <Error>` — and because a word that needs no argument to
+/// demonstrate one is a word you can also just click.
+///
+/// Whether the row is FREE is not asked here and is not this word's business:
+/// an armed prompt outranks a message at render time, so posting under one is
+/// stored and invisible, exactly as a save finishing under one is. Nor does
+/// anything here decide when it goes away — your next key or click does, on
+/// every pane at once, because a message is exactly as old as your last input.
+pub const Msg = struct {
+ pub const takes_arg = true;
+ pub fn run(c: Ctx) void {
+ if (c.arg) |text|
+ c.p.setMessage(c.id, text)
+ else
+ c.p.reportError(c.id, comptime word(@This()), error.NoMessage);
+ }
+};
+
// ---- display toggles ----
pub const Debug = struct {
@@ -357,6 +387,7 @@ pub const Font = struct {
if (path.len > fonts.want_buf.len) return;
@memcpy(fonts.want_buf[0..path.len], path);
fonts.want = fonts.want_buf[0..path.len];
+ fonts.chosen = std.fs.path.stem(fonts.want.?);
}
};