refactor: show keybindview when started with --show-input

This commit is contained in:
CJ van den Berg 2025-12-10 15:59:09 +01:00
parent 3071c10892
commit e9f51388f7
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -109,8 +109,10 @@ pub fn create(allocator: std.mem.Allocator) CreateError!Widget {
if (tui.config().bottom_bar.len > 0) { if (tui.config().bottom_bar.len > 0) {
self.bottom_bar = (try widgets.addP(try @import("status/bar.zig").create(allocator, self.plane, tui.config().bottom_bar, .grip, EventHandler.bind(self, handle_bottom_bar_event)))).*; self.bottom_bar = (try widgets.addP(try @import("status/bar.zig").create(allocator, self.plane, tui.config().bottom_bar, .grip, EventHandler.bind(self, handle_bottom_bar_event)))).*;
} }
if (tp.env.get().is("show-input")) if (tp.env.get().is("show-input")) {
self.toggle_inputview_async(); self.toggle_inputview_async();
self.toggle_keybindview_async();
}
if (tp.env.get().is("show-log")) if (tp.env.get().is("show-log"))
self.toggle_logview_async(); self.toggle_logview_async();
return w; return w;
@ -1650,6 +1652,10 @@ fn toggle_inputview_async(_: *Self) void {
tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return; tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return;
} }
fn toggle_keybindview_async(_: *Self) void {
tp.self_pid().send(.{ "cmd", "toggle_keybindview" }) catch return;
}
fn show_file_async(_: *Self, file_path: []const u8) void { fn show_file_async(_: *Self, file_path: []const u8) void {
tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }) catch return; tp.self_pid().send(.{ "cmd", "navigate", .{ .file = file_path } }) catch return;
} }