Merge branch 'master' into zig-0.14
This commit is contained in:
commit
5fc2247bc3
4 changed files with 21 additions and 5 deletions
12
src/main.zig
12
src/main.zig
|
@ -76,6 +76,8 @@ 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",
|
||||
.new_file = "Create a new untitled file on start",
|
||||
.version = "Show build version and exit",
|
||||
};
|
||||
|
||||
|
@ -89,6 +91,8 @@ pub fn main() anyerror!void {
|
|||
.language = 'l',
|
||||
.exec = 'e',
|
||||
.literal = 'L',
|
||||
.scratch = 'S',
|
||||
.new_file = 'n',
|
||||
.version = 'v',
|
||||
};
|
||||
|
||||
|
@ -110,6 +114,8 @@ pub fn main() anyerror!void {
|
|||
syntax_report_timing: bool,
|
||||
exec: ?[]const u8,
|
||||
literal: bool,
|
||||
scratch: bool,
|
||||
new_file: bool,
|
||||
version: bool,
|
||||
};
|
||||
|
||||
|
@ -320,6 +326,12 @@ pub fn main() anyerror!void {
|
|||
try tui_proc.send(.{ "cmd", "show_home" });
|
||||
}
|
||||
|
||||
if (args.new_file) {
|
||||
try tui_proc.send(.{ "cmd", "create_new_file", .{} });
|
||||
} else 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, .{} });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue