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,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: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue