diff --git a/src/commands.zig b/src/commands.zig index c505f0e..e5c296a 100644 --- a/src/commands.zig +++ b/src/commands.zig @@ -71,7 +71,8 @@ pub fn targetFile(path: []const u8, call: *sdk.Command.Call) !*File { return file; } -/// Commands running now: an edit made with none running is the person's (`History.person`). +/// Pixi's commands running now: the person's activity is told with the answer of the one that acts +/// on a sprite (`bind`, `targetFile`). Whose an edit is, is the host's (`Host.author`). pub var running: u32 = 0; /// The person's activity on the sprite the running command acts on, taken by `targetFile` and /// told with the command's answer (`bind`). diff --git a/src/internal/History.zig b/src/internal/History.zig index 44f66ce..c09d17f 100644 --- a/src/internal/History.zig +++ b/src/internal/History.zig @@ -410,7 +410,7 @@ pub fn append(self: *History, change: Change) !void { // fizzy hears of every edit, to show the command that made it. file.finishReveal(); runtime.state().host.documentEdited(file.id); - if (commands.running == 0) { + if (runtime.state().host.author().kind == .person) { self.person.edits += 1; self.person.note(std.meta.activeTag(change)); } @@ -512,7 +512,7 @@ pub fn undoRedo(self: *History, file: *pixi.internal.File, action: Action) !void if (active_stack.items.len == 0) return; defer runtime.state().host.documentEdited(file.id); if (action == .undo and !self.keeping) self.went_back_by = runtime.state().host.acted(); - if (commands.running == 0 and !self.keeping) { + if (runtime.state().host.author().kind == .person and !self.keeping) { switch (action) { .undo => self.person.undone += 1, .redo => self.person.redone += 1,