diff options
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index 578a60dd..b89952cd 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -345,6 +345,17 @@ pub const Save = struct { } }; +/// Ask the native shell for an atomically-created empty temporary file. The +/// pane and its lifetime serial are the placement token: by the time IO +/// finishes another column may be active, or this slot may even have been +/// reused, and neither is permission to put the document somewhere else. +pub const New = struct { + pub fn run(c: Ctx) void { + if (c.p.freeSlot() == null) return; + c.p.emit(.{ .new_file = .{ .pane = @intCast(c.id), .serial = c.pane.serial } }); + } +}; + pub const Newcol = struct { pub fn run(c: Ctx) void { const free = c.p.freeSlot() orelse return; |
