Files
zterm/src/widget/Spacer.zig
Yves Biener b32556720e
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 32s
add(widget/Spacer): empty widget implementation
2024-11-10 00:13:47 +01:00

34 lines
861 B
Zig

const std = @import("std");
const terminal = @import("../terminal.zig");
const isTaggedUnion = @import("../event.zig").isTaggedUnion;
const Error = @import("../event.zig").Error;
const log = std.log.scoped(.widget_spacer);
pub fn Widget(comptime Event: type) type {
if (!isTaggedUnion(Event)) {
@compileError("Provided user event `Event` for `Layout(comptime Event: type)` is not of type `union(enum)`.");
}
return struct {
pub fn init() @This() {
return .{};
}
pub fn deinit(this: *@This()) void {
this.* = undefined;
}
pub fn handle(this: *@This(), event: Event) ?Event {
_ = this;
_ = event;
return null;
}
pub fn content(this: *@This()) ![]u8 {
_ = this;
return &[0]u8{};
}
};
}