Fix insert mode hack + fix bugs

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2026-03-17 23:58:06 +01:00
parent acac884cfe
commit 9c50297059
9 changed files with 129 additions and 65 deletions

View File

@@ -18,7 +18,7 @@ const EnvironmentLabel = CyclableLabel(Env, *UserList);
const Session = @This();
label: EnvironmentLabel,
label: *EnvironmentLabel,
user_list: *UserList,
pub fn init(
@@ -29,9 +29,9 @@ pub fn init(
text_in_center: bool,
fg: u32,
bg: u32,
) Session {
) !Session {
return .{
.label = EnvironmentLabel.init(
.label = try EnvironmentLabel.init(
allocator,
buffer,
drawItem,
@@ -58,7 +58,7 @@ pub fn deinit(self: *Session) void {
pub fn widget(self: *Session) Widget {
return Widget.init(
"Session",
null,
self.label.keybinds,
self,
deinit,
null,
@@ -80,8 +80,8 @@ fn draw(self: *Session) void {
self.label.draw();
}
fn handle(self: *Session, maybe_key: ?keyboard.Key, insert_mode: bool) !void {
self.label.handle(maybe_key, insert_mode);
fn handle(self: *Session, maybe_key: ?keyboard.Key) !void {
self.label.handle(maybe_key);
}
fn addedSession(env: Env, user_list: *UserList) void {