feat: add cli option to open the log view on startup

This commit is contained in:
CJ van den Berg 2024-03-21 22:48:49 +01:00
parent 4970f29905
commit a056a54104
2 changed files with 8 additions and 0 deletions

View file

@ -62,6 +62,8 @@ pub fn create(a: std.mem.Allocator, n: nc.Plane) !Widget {
self.resize();
if (tp.env.get().is("show-input"))
self.toggle_inputview_async();
if (tp.env.get().is("show-log"))
self.toggle_logview_async();
return w;
}
@ -339,6 +341,10 @@ fn create_editor(self: *Self) tp.result {
self.resize();
}
fn toggle_logview_async(_: *Self) void {
tp.self_pid().send(.{ "cmd", "toggle_logview" }) catch return;
}
fn toggle_inputview_async(_: *Self) void {
tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return;
}