Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/commands.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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`).
Expand Down
4 changes: 2 additions & 2 deletions src/internal/History.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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,
Expand Down
Loading