summaryrefslogtreecommitdiff
path: root/core/Messages.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Messages.zig')
-rw-r--r--core/Messages.zig15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/Messages.zig b/core/Messages.zig
index e05961b5..fb2c3cde 100644
--- a/core/Messages.zig
+++ b/core/Messages.zig
@@ -435,6 +435,18 @@ pub fn ink(chrome: *const pardes.colors.ChromeTheme, kind: Kind) [3]u8 {
};
}
+/// A message's ink on a ground of the chrome (R9): an error's, a warning's
+/// and a question's their severity's held there (a question info's), an
+/// echo, a notice and progress the ground's dim ink.
+pub fn inkOn(inks: *const pardes.colors.Chrome.Inks, kind: Kind) [3]u8 {
+ return switch (kind) {
+ .@"error" => inks.severity[0],
+ .warn => inks.severity[1],
+ .question => inks.severity[2],
+ .echo, .notice, .progress => inks.dim,
+ };
+}
+
/// The places a compiler's report names put on `s`: each
/// `path:line:col: error|warning|note: words` row (a relative path is
/// `dir`'s), its words there, each place once, and the rows after the
@@ -1554,7 +1566,8 @@ test "a question never adds a row to its tag: at every width the asking tag take
}
test "a file changed on disk under unsaved text asks in its tag and never takes the keyboard: SPC e's keyboard answers, d shows the disk's lines as ghosts, Esc leaves it waiting, B2 on Reload reads it again" {
- const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20 });
+ // Wide: the tag at rest one row (UX K'3), the question whole in it.
+ const p = try Pardes.init(std.testing.allocator, .{ .cols = 200, .rows = 20 });
defer p.deinit();
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();