feat: add --new-file command line parameter
This commit is contained in:
parent
9bedb9eccd
commit
c537adbcdd
1 changed files with 6 additions and 1 deletions
|
@ -73,6 +73,7 @@ pub fn main() anyerror!void {
|
||||||
.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",
|
.scratch = "Open a scratch (temporary) buffer on start",
|
||||||
|
.new_file = "Create a new untitled file on start",
|
||||||
.version = "Show build version and exit",
|
.version = "Show build version and exit",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -87,6 +88,7 @@ pub fn main() anyerror!void {
|
||||||
.exec = 'e',
|
.exec = 'e',
|
||||||
.literal = 'L',
|
.literal = 'L',
|
||||||
.scratch = 'S',
|
.scratch = 'S',
|
||||||
|
.new_file = 'n',
|
||||||
.version = 'v',
|
.version = 'v',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -109,6 +111,7 @@ pub fn main() anyerror!void {
|
||||||
exec: ?[]const u8,
|
exec: ?[]const u8,
|
||||||
literal: bool,
|
literal: bool,
|
||||||
scratch: bool,
|
scratch: bool,
|
||||||
|
new_file: bool,
|
||||||
version: bool,
|
version: bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -319,7 +322,9 @@ pub fn main() anyerror!void {
|
||||||
try tui_proc.send(.{ "cmd", "show_home" });
|
try tui_proc.send(.{ "cmd", "show_home" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.scratch) {
|
if (args.new_file) {
|
||||||
|
try tui_proc.send(.{ "cmd", "create_new_file", .{} });
|
||||||
|
} else if (args.scratch) {
|
||||||
try tui_proc.send(.{ "cmd", "create_scratch_buffer", .{} });
|
try tui_proc.send(.{ "cmd", "create_scratch_buffer", .{} });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue