Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo & Redo #12

Open
2 of 3 tasks
lpan opened this issue Aug 14, 2017 · 0 comments
Open
2 of 3 tasks

Undo & Redo #12

lpan opened this issue Aug 14, 2017 · 0 comments

Comments

@lpan
Copy link
Owner

lpan commented Aug 14, 2017

The idea

The goal is to use command pattern and event sourcing. We model all state mutation methods as commands and register them in a stack. When the user hits undo button, we pop the first command and replay all the commands on the initial buffer. the popped command will be added to undo_stack. As for redo, we will pop the undo_stack and apply the command to the current buffer.

TODOs

  • Refactor state->buffer into state->text_buffer and state->status_line_buffer.

  • Clone text_buffer by value (cloning a 2d doubly linked list 😛 )

  • undo_stack and history_stack

@lpan lpan mentioned this issue Aug 15, 2017
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant