From 6eaef79f433b2c29448925b4be57529f55cdeff3 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 26 Mar 2025 19:22:16 +0100 Subject: [PATCH] feat: add debug build warning to home screen --- src/tui/home.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tui/home.zig b/src/tui/home.zig index 60a9612..a1684e5 100644 --- a/src/tui/home.zig +++ b/src/tui/home.zig @@ -3,6 +3,7 @@ const build_options = @import("build_options"); const tp = @import("thespian"); const log = @import("log"); const cbor = @import("cbor"); +const builtin = @import("builtin"); const Plane = @import("renderer").Plane; const root = @import("root"); @@ -307,6 +308,15 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool { ) catch {}; self.plane.set_style_bg_transparent(style_subtext); _ = self.plane.print("{s}", .{root.version}) catch return false; + if (builtin.mode == .Debug) { + const debug_warning_text = "debug build"; + self.plane.cursor_move_yx( + @intCast(self.plane.dim_y() - 3), + @intCast(@max(self.plane.dim_x(), debug_warning_text.len + 3) - debug_warning_text.len - 3), + ) catch {}; + self.plane.set_style_bg_transparent(theme.editor_error); + _ = self.plane.print("{s}", .{debug_warning_text}) catch return false; + } const more = self.menu.render(theme); return more or self.fire != null;