diff --git a/src/main.zig b/src/main.zig index e7adc38..4edf23f 100644 --- a/src/main.zig +++ b/src/main.zig @@ -72,6 +72,7 @@ pub fn main() anyerror!void { .syntax_report_timing = "Report syntax highlighting time", .exec = "Execute a command on startup", .literal = "Disable :LINE and +LINE syntax", + .scratch = "Open a scratch (temporary) buffer on start", .version = "Show build version and exit", }; @@ -85,6 +86,7 @@ pub fn main() anyerror!void { .language = 'l', .exec = 'e', .literal = 'L', + .scratch = 'S', .version = 'v', }; @@ -106,6 +108,7 @@ pub fn main() anyerror!void { syntax_report_timing: bool, exec: ?[]const u8, literal: bool, + scratch: bool, version: bool, }; @@ -316,6 +319,10 @@ pub fn main() anyerror!void { try tui_proc.send(.{ "cmd", "show_home" }); } + if (args.scratch) { + try tui_proc.send(.{ "cmd", "create_scratch_buffer", .{} }); + } + if (args.exec) |exec_str| { var cmds = std.mem.splitScalar(u8, exec_str, ';'); while (cmds.next()) |cmd| try tui_proc.send(.{ "cmd", cmd, .{} });