summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig15
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;