Merge branch 'master' into zig-0.14

This commit is contained in:
CJ van den Berg 2025-02-13 12:08:54 +01:00
commit 5fc2247bc3
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 21 additions and 5 deletions

View file

@ -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, .{} });