mod(memory): do not create items on the stack instead using the provided allocator
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 4m26s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 4m26s
This commit is contained in:
@@ -31,41 +31,26 @@ pub fn main() !void {
|
||||
// TODO: when not running fullscreen, the application needs to screen down accordingly to display the contents
|
||||
// -> size hint how much should it use?
|
||||
|
||||
var layout = Layout.createFrom(layout: {
|
||||
var container = Layout.VContainer.init(allocator, .{
|
||||
.{
|
||||
Widget.createFrom(blk: {
|
||||
var spacer = Widget.Spacer.init();
|
||||
break :blk &spacer;
|
||||
}),
|
||||
45,
|
||||
},
|
||||
.{
|
||||
Layout.createFrom(framing: {
|
||||
var framing = Layout.Framing.init(allocator, .{}, .{
|
||||
.widget = Widget.createFrom(blk: {
|
||||
var widget = Widget.Text.init(.center, &[_]Cell{
|
||||
.{ .content = "Press " },
|
||||
.{ .content = "Ctrl+n", .style = .{ .fg = .{ .index = 6 } } },
|
||||
.{ .content = " to launch $EDITOR" },
|
||||
});
|
||||
break :blk &widget;
|
||||
}),
|
||||
});
|
||||
break :framing &framing;
|
||||
}),
|
||||
10,
|
||||
},
|
||||
.{
|
||||
Widget.createFrom(blk: {
|
||||
var spacer = Widget.Spacer.init();
|
||||
break :blk &spacer;
|
||||
}),
|
||||
45,
|
||||
},
|
||||
});
|
||||
break :layout &container;
|
||||
});
|
||||
var layout = Layout.createFrom(Layout.VContainer.init(allocator, .{
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
45,
|
||||
},
|
||||
.{
|
||||
Layout.createFrom(Layout.Framing.init(allocator, .{}, .{
|
||||
.widget = Widget.createFrom(Widget.Text.init(allocator, .center, &[_]Cell{
|
||||
.{ .content = "Press " },
|
||||
.{ .content = "Ctrl+n", .style = .{ .fg = .{ .index = 6 } } },
|
||||
.{ .content = " to launch $EDITOR" },
|
||||
})),
|
||||
})),
|
||||
10,
|
||||
},
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
45,
|
||||
},
|
||||
}));
|
||||
defer layout.deinit();
|
||||
|
||||
const min_size: zterm.Size = .{
|
||||
|
||||
Reference in New Issue
Block a user