feat: add cli option to open the input view on start

This commit is contained in:
CJ van den Berg 2024-02-29 09:50:25 +01:00
parent 61610f579a
commit 21bac1ab0c
2 changed files with 8 additions and 0 deletions

View file

@ -57,6 +57,8 @@ pub fn create(a: std.mem.Allocator, n: nc.Plane) !Widget {
try widgets.add(try Widget.empty(a, n, .dynamic));
self.statusbar = try widgets.addP(try @import("status/statusbar.zig").create(a, w));
self.resize();
if (tp.env.get().is("show-input"))
self.toggle_inputview_async();
return w;
}
@ -335,6 +337,10 @@ fn create_editor(self: *Self) tp.result {
self.resize();
}
fn toggle_inputview_async(_: *Self) void {
tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return;
}
fn show_home_async(_: *Self) void {
tp.self_pid().send(.{ "cmd", "show_home" }) catch return;
}