From 8d16fb41abfe346d0f6b2a8bb085f15b60256f12 Mon Sep 17 00:00:00 2001 From: Garrett Mills Date: Sun, 22 Feb 2026 10:11:49 -0600 Subject: [PATCH] History - fix off-by-one error --- src/vm/commands/redo.ts | 2 +- src/vm/commands/undo.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vm/commands/redo.ts b/src/vm/commands/redo.ts index 0f86c98..12cf831 100644 --- a/src/vm/commands/redo.ts +++ b/src/vm/commands/redo.ts @@ -24,7 +24,7 @@ export class Redo extends Command<{ steps?: StrTerm }> { : 1 await vm.control$.next({ cmd: 'preserve-history' }) - for ( let i = 0; i <= steps; i++) { + for ( let i = 0; i < steps; i++) { await vm.control$.next({ cmd: 'redo' }) } diff --git a/src/vm/commands/undo.ts b/src/vm/commands/undo.ts index 86d490d..cec27d7 100644 --- a/src/vm/commands/undo.ts +++ b/src/vm/commands/undo.ts @@ -24,7 +24,7 @@ export class Undo extends Command<{ steps?: StrTerm }> { : 1 await vm.control$.next({ cmd: 'preserve-history' }) - for ( let i = 0; i <= steps; i++) { + for ( let i = 0; i < steps; i++) { await vm.control$.next({ cmd: 'undo' }) }