refactor: support direct calling of keybind.BindingSet

This commit is contained in:
CJ van den Berg 2026-02-24 23:15:15 +01:00
parent 613b95c2af
commit 6643341574
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -667,7 +667,7 @@ const BindingSet = struct {
} }
} }
fn receive(self: *const @This(), _: tp.pid_ref, m: tp.message) error{Exit}!bool { pub fn receive(self: *const @This(), _: tp.pid_ref, m: tp.message) error{Exit}!bool {
var event: input.Event = 0; var event: input.Event = 0;
var keypress: input.Key = 0; var keypress: input.Key = 0;
var keypress_shifted: input.Key = 0; var keypress_shifted: input.Key = 0;
@ -696,6 +696,7 @@ const BindingSet = struct {
} }
for (binding.commands) |*cmd| try cmd.execute(); for (binding.commands) |*cmd| try cmd.execute();
return true;
} }
} else if (try m.match(.{"F"})) { } else if (try m.match(.{"F"})) {
self.flush() catch |e| return tp.exit_error(e, @errorReturnTrace()); self.flush() catch |e| return tp.exit_error(e, @errorReturnTrace());