Join Nostr
2026-05-23 08:35:31 UTC

Doug Binks on Nostr: A slightly complex part of undo/redo systems is handling reaching the undo/redo ...

A slightly complex part of undo/redo systems is handling reaching the undo/redo limit. One option is to never have a limit, but for now I've opted to handle this.

When you reach the limit you need to remove items from the tail with same undo id. In case of a very large single operation overwhelming the undo storage you also need to reject new operations with the same id you deleted, otherwise you could 'undo' partial operations and get into a worse state than not undoing them.