feat: add --scratch command line parameter
This commit is contained in:
parent
47c7b37968
commit
9bedb9eccd
1 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,7 @@ pub fn main() anyerror!void {
|
||||||
.syntax_report_timing = "Report syntax highlighting time",
|
.syntax_report_timing = "Report syntax highlighting time",
|
||||||
.exec = "Execute a command on startup",
|
.exec = "Execute a command on startup",
|
||||||
.literal = "Disable :LINE and +LINE syntax",
|
.literal = "Disable :LINE and +LINE syntax",
|
||||||
|
.scratch = "Open a scratch (temporary) buffer on start",
|
||||||
.version = "Show build version and exit",
|
.version = "Show build version and exit",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ pub fn main() anyerror!void {
|
||||||
.language = 'l',
|
.language = 'l',
|
||||||
.exec = 'e',
|
.exec = 'e',
|
||||||
.literal = 'L',
|
.literal = 'L',
|
||||||
|
.scratch = 'S',
|
||||||
.version = 'v',
|
.version = 'v',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,6 +108,7 @@ pub fn main() anyerror!void {
|
||||||
syntax_report_timing: bool,
|
syntax_report_timing: bool,
|
||||||
exec: ?[]const u8,
|
exec: ?[]const u8,
|
||||||
literal: bool,
|
literal: bool,
|
||||||
|
scratch: bool,
|
||||||
version: bool,
|
version: bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -316,6 +319,10 @@ pub fn main() anyerror!void {
|
||||||
try tui_proc.send(.{ "cmd", "show_home" });
|
try tui_proc.send(.{ "cmd", "show_home" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.scratch) {
|
||||||
|
try tui_proc.send(.{ "cmd", "create_scratch_buffer", .{} });
|
||||||
|
}
|
||||||
|
|
||||||
if (args.exec) |exec_str| {
|
if (args.exec) |exec_str| {
|
||||||
var cmds = std.mem.splitScalar(u8, exec_str, ';');
|
var cmds = std.mem.splitScalar(u8, exec_str, ';');
|
||||||
while (cmds.next()) |cmd| try tui_proc.send(.{ "cmd", cmd, .{} });
|
while (cmds.next()) |cmd| try tui_proc.send(.{ "cmd", cmd, .{} });
|
||||||
|
|
Loading…
Add table
Reference in a new issue