You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
The idea
The goal is to use
command pattern
andevent sourcing
. We model all state mutation methods ascommand
s and register them in a stack. When the user hitsundo
button, we pop the first command and replay all the commands on the initial buffer. the poppedcommand
will be added toundo_stack
. As forredo
, we will pop theundo_stack
and apply the command to the current buffer.TODOs
Refactor
state->buffer
intostate->text_buffer
andstate->status_line_buffer
.Clone
text_buffer
by value (cloning a 2d doubly linked list 😛 )undo_stack
andhistory_stack
The text was updated successfully, but these errors were encountered: