Skip to content

Allow clearing the undo/redo stack of a custom editor on save #296528

Closed

Description

@lppedd

There are cases of CustomEditorProvider implementations that do support using onDidChangeCustomDocument<CustomDocumentEditEvent>, but only up to a save point.

Currently, the emitted edit events are retained even after a save operation, but the editor itself might have lost (for good reasons) the state required to perform those retained undos/redos.

The only possible solution in such cases is to be able to tell VS Code to clear the undo/redo stack on save.

Activity

  1. lppedd commented on Feb 21, 2026

    @lppedd
    Author

    A more generalized approach might be even better, e.g., by offering a second event emitter.

    onDidEditStackClear<void>
  2. added
    unreleased
    on Mar 3, 2026
  3. added this to the 1.111.0 milestone on Mar 3, 2026
  4. lppedd commented on Mar 3, 2026

    @lppedd
    Author

    Connor Peet (@connor4312) you might have accidentally used the wrong ref with that commit.

  5. removed
    unreleased
    on Mar 3, 2026
  6. lppedd commented on Mar 19, 2026

    @lppedd
    Author

    Henning Dieterichs (@hediet) hey there! Just wondering if closing this issue was a mistake (as I can't see any reference to PRs/commits).

  7. lppedd commented on Mar 20, 2026

    @lppedd
    Author

    Matt Bierner (@mjbvz) would it be possible to reopen it in the meantime? I don't want it to be locked automatically.

  8. lppedd commented on Mar 30, 2026

    @lppedd
    Author

    Let me know if it can be reopened, or I'll create a fresh one in case.

  9. locked and limited conversation to collaborators on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions