WIP: render keybinding that match the current keybind prefix
This commit is contained in:
parent
03b01f9712
commit
9557703fc9
1 changed files with 20 additions and 5 deletions
|
|
@ -300,12 +300,27 @@ fn handle_input_idle(self: *Self) void {
|
||||||
if (self.input_mode_) |mode| {
|
if (self.input_mode_) |mode| {
|
||||||
const bindings = mode.current_key_event_sequence_bindings(self.allocator) catch return;
|
const bindings = mode.current_key_event_sequence_bindings(self.allocator) catch return;
|
||||||
defer self.allocator.free(bindings);
|
defer self.allocator.free(bindings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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|
|
for (bindings) |binding|
|
||||||
self.logger.print(" {f} => {s}", .{
|
top_layer_.plane.print(" {f} => {s}", .{
|
||||||
keybind.key_event_sequence_fmt(binding.key_events),
|
keybind.key_event_sequence_fmt(binding.key_events),
|
||||||
binding.commands[0].command,
|
binding.commands[0].command,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_input_idle_timer(self: *Self) void {
|
fn update_input_idle_timer(self: *Self) void {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue