feat: add cli option to open the log view on startup
This commit is contained in:
parent
4970f29905
commit
a056a54104
2 changed files with 8 additions and 0 deletions
|
@ -25,6 +25,7 @@ pub fn main() anyerror!void {
|
||||||
\\--no-trace Do not enable internal tracing.
|
\\--no-trace Do not enable internal tracing.
|
||||||
\\--restore-session Restore restart session.
|
\\--restore-session Restore restart session.
|
||||||
\\--show-input Open the input view on start.
|
\\--show-input Open the input view on start.
|
||||||
|
\\--show-log Open the log view on start.
|
||||||
\\-l, --language <str> Force the language of the file to be opened.
|
\\-l, --language <str> Force the language of the file to be opened.
|
||||||
\\<str>... File to open.
|
\\<str>... File to open.
|
||||||
\\ Add +<LINE> to the command line or append
|
\\ Add +<LINE> to the command line or append
|
||||||
|
@ -85,6 +86,7 @@ pub fn main() anyerror!void {
|
||||||
env.set("restore-session", (res.args.@"restore-session" != 0));
|
env.set("restore-session", (res.args.@"restore-session" != 0));
|
||||||
env.set("no-alternate", (res.args.@"no-alternate" != 0));
|
env.set("no-alternate", (res.args.@"no-alternate" != 0));
|
||||||
env.set("show-input", (res.args.@"show-input" != 0));
|
env.set("show-input", (res.args.@"show-input" != 0));
|
||||||
|
env.set("show-log", (res.args.@"show-log" != 0));
|
||||||
env.set("no-sleep", (res.args.@"no-sleep" != 0));
|
env.set("no-sleep", (res.args.@"no-sleep" != 0));
|
||||||
env.set("dump-stack-trace", (res.args.@"debug-dump-on-error" != 0));
|
env.set("dump-stack-trace", (res.args.@"debug-dump-on-error" != 0));
|
||||||
if (res.args.@"frame-rate") |s| env.num_set("frame-rate", @intCast(s));
|
if (res.args.@"frame-rate") |s| env.num_set("frame-rate", @intCast(s));
|
||||||
|
|
|
@ -62,6 +62,8 @@ pub fn create(a: std.mem.Allocator, n: nc.Plane) !Widget {
|
||||||
self.resize();
|
self.resize();
|
||||||
if (tp.env.get().is("show-input"))
|
if (tp.env.get().is("show-input"))
|
||||||
self.toggle_inputview_async();
|
self.toggle_inputview_async();
|
||||||
|
if (tp.env.get().is("show-log"))
|
||||||
|
self.toggle_logview_async();
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,6 +341,10 @@ fn create_editor(self: *Self) tp.result {
|
||||||
self.resize();
|
self.resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn toggle_logview_async(_: *Self) void {
|
||||||
|
tp.self_pid().send(.{ "cmd", "toggle_logview" }) catch return;
|
||||||
|
}
|
||||||
|
|
||||||
fn toggle_inputview_async(_: *Self) void {
|
fn toggle_inputview_async(_: *Self) void {
|
||||||
tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return;
|
tp.self_pid().send(.{ "cmd", "toggle_inputview" }) catch return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue