hooks can now be deleted

This commit is contained in:
Squibid 2025-12-14 20:41:26 -05:00
parent 49e0875a85
commit 8d980ad032
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 45 additions and 20 deletions

View file

@ -45,7 +45,7 @@ cursor: Cursor,
// Lua data
keymaps: std.AutoHashMap(u64, Keymap),
hooks: std.ArrayList(*Hook),
hooks: std.AutoHashMap(i32, *Hook),
events: Events,
remote_lua_clients: std.DoublyLinkedList,
@ -102,7 +102,7 @@ pub fn init(self: *Server) void {
.cursor = undefined,
.remote_lua_manager = RemoteLuaManager.init() catch Utils.oomPanic(),
.keymaps = .init(gpa),
.hooks = try .initCapacity(gpa, 10), // TODO: choose how many slots to start with
.hooks = .init(gpa),
.events = try .init(gpa),
.remote_lua_clients = .{},
};