Text Editor Data Structures: Rethinking Undo

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • immer

    Postmodern immutable and persistent data structures for C++ — value semantics at scale (by arximboldi)

  • I've been working on an editor (not text) in C++ and pretty early got into undo/redo. I went down the route of doIt/undoIt for commands but that quickly got old. There was both the extra work needed to implement undo separately for every operation, but also the nagging feeling that the undo operation for some operation wasn't implemented correctly.

    In the end, I switched to representing the entire document state using persistent data structures (using the immer library). This vastly simplified things and implementing undo/redo becomes absolutely trivial when using persistent data structures. It's probably not something that is suitable for all domains, but worth checking out.

    https://github.com/arximboldi/immer

  • undo-tree

  • vundo is a simpler implementation: it reuses Emacs's tree and just implements the visualisation part.

    undo-tree is a reimplementation of Emacs's tree based undo, that supports a visualization.

    * undo-tree LOC: 4700. https://gitlab.com/tsc25/undo-tree/-/blob/master/undo-tree.e...

    * vundo LOC: 1350. https://github.com/casouri/vundo/blob/master/vundo.el

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • vundo

    Visualize the undo tree.

  • vundo is a simpler implementation: it reuses Emacs's tree and just implements the visualisation part.

    undo-tree is a reimplementation of Emacs's tree based undo, that supports a visualization.

    * undo-tree LOC: 4700. https://gitlab.com/tsc25/undo-tree/-/blob/master/undo-tree.e...

    * vundo LOC: 1350. https://github.com/casouri/vundo/blob/master/vundo.el

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts