WIP: render keybinding that match the current keybind prefix

This commit is contained in:
CJ van den Berg 2025-11-30 15:03:42 +01:00
parent 03b01f9712
commit 9557703fc9
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -300,14 +300,29 @@ fn handle_input_idle(self: *Self) void {
if (self.input_mode_) |mode| {
const bindings = mode.current_key_event_sequence_bindings(self.allocator) catch return;
defer self.allocator.free(bindings);
for (bindings) |binding|
self.logger.print(" {f} => {s}", .{
keybind.key_event_sequence_fmt(binding.key_events),
binding.commands[0].command,
});
}
}
fn render_keybind_matches(self: *Self) void {
var box = screen();
// const anchor: Widget.Pos = .{};
// box.y = @intCast(@max(pos.y, anchor.y) - anchor.y);
// box.x = @intCast(@max(pos.x, anchor.x) - anchor.x);
// return if something is already rendering to the top layer
const top_layer_ = top_layer(box.to_layer()) orelse return;
const mode = self.input_mode_ orelse return;
const bindings = mode.current_key_event_sequence_bindings(self.allocator) catch return;
defer self.allocator.free(bindings);
for (bindings) |binding|
top_layer_.plane.print(" {f} => {s}", .{
keybind.key_event_sequence_fmt(binding.key_events),
binding.commands[0].command,
});
}
fn update_input_idle_timer(self: *Self) void {
if (!self.enable_input_idle_timer) return;
if (self.input_is_idle) blk: {