diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 18:01:07 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 18:08:12 -0300 |
| commit | 7f748c657121c801f219b28680373729fefce82a (patch) | |
| tree | 36ab19fece32e4b0b76778119045e3a21d32fbc6 /src/builtins.zig | |
| parent | 9dba9742f4f2071fd85c67c3a7fe311b7f37617c (diff) | |
| download | pardes-7f748c657121c801f219b28680373729fefce82a.tar.gz pardes-7f748c657121c801f219b28680373729fefce82a.zip | |
Putall saves every pane holding unsaved edits to a file, each as its own Save, a refused one said and the rest saved all the same
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index 1d524514..8fcc3c01 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -1144,6 +1144,21 @@ pub const Get = struct { } }; +/// acme's Putall: every pane holding unsaved edits to a file is saved, each +/// as its own Save; one that is refused (changed on disk since, a write +/// that fails) says so and the rest are saved all the same. +pub const Putall = struct { + pub const scope: Scope = .session; + pub fn run(c: Ctx) void { + for (c.p.panes, 0..) |slot, id| { + const pane = slot orelse continue; + const f = pane.file orelse continue; + if (f.output != null or f.listing != null or f.revision == f.saved_revision) continue; + exec.saveFile(c.p, id); + } + } +}; + /// Write the pane's text to its file, or to the file its argument names. pub const Save = struct { pub const takes_arg = true; |
