feat: allow setting the file type in create_scratch_buffer command
Also, fix args forwarding.
This commit is contained in:
parent
404ba8bb0e
commit
a706e0b976
2 changed files with 16 additions and 10 deletions
|
@ -386,12 +386,14 @@ const cmds = struct {
|
|||
pub const open_gui_config_meta = .{ .description = "Edit gui configuration file" };
|
||||
|
||||
pub fn create_scratch_buffer(self: *Self, ctx: Ctx) Result {
|
||||
const args = try ctx.args.clone(self.allocator);
|
||||
defer self.allocator.free(args.buf);
|
||||
tui.reset_drag_context();
|
||||
try self.create_editor();
|
||||
try command.executeName("open_scratch_buffer", ctx);
|
||||
try command.executeName("open_scratch_buffer", .{ .args = args });
|
||||
tui.need_render();
|
||||
}
|
||||
pub const create_scratch_buffer_meta = .{ .arguments = &.{ .string, .string } };
|
||||
pub const create_scratch_buffer_meta = .{ .arguments = &.{ .string, .string, .string } };
|
||||
|
||||
pub fn create_new_file(self: *Self, _: Ctx) Result {
|
||||
var n: usize = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue