From 641d92a5cc45d139a5adc4aff109dfb12d53306f Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 13 Feb 2025 11:51:10 +0100 Subject: [PATCH] feat: allow calling create_scratch_buffer with no parameters --- src/tui/editor.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 59fa97c..fd31e39 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -4072,7 +4072,10 @@ pub const Editor = struct { } else if (ctx.args.match(.{tp.extract(&file_path)}) catch false) { try self.open_scratch(file_path, "", null); self.clamp(); - } else return error.InvalidOpenScratchBufferArgument; + } else { + try self.open_scratch("*scratch*", "", null); + self.clamp(); + } } pub const open_scratch_buffer_meta = .{ .arguments = &.{ .string, .string } };