Skip to content

Maintanence: Rework undo/redo #3

@preiter93

Description

@preiter93

The Undo/Redo function is still experimental. It currently works as follows

  • Capture the entire editor state before deletion
  • On unde, rewind the editor state

This is resource-intensive and does not capture all cases in which undo should be possible. New approach

  • Add UndoAction
  • Each undoable action registers an UndoAction
  • When undoing, the UndoActions are executed

Actions that should have an undo

  • RemoveChar in normal mode
  • DeleteSelection in visual mode
  • After inserting in insert mode.
    This is tricky, we need to keep track of what was added and what was removed. Maybe it is enough to save at which cursor position we started and what was added or deleted.
  • Paste

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions