refactor: show keybindview when started with --show-input
This commit is contained in:
parent
3071c10892
commit
e9f51388f7
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue