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

add support for undo and redo to vi KeyMap #28

Closed
wants to merge 7 commits into from

Conversation

iamcodemaker
Copy link
Contributor

@iamcodemaker iamcodemaker commented Feb 7, 2017

This adds support for undo and redo to the vi KeyMap. This required adding the concept of an undo group to the Buffer struct.

#6

Depends on #27
Blocks #29

This will be used later. Right now we just properly track the count.
This will repeat the last insert `count` times.
This command repeats the last normal command or the last insert
command. It also supports counts.
This is necessary to support proper undoing in insert mode.
This also properly marks the start and end of undo groups in order to
properly support undoing and redoing commands with counts and insert
commands.
pub fn current_buffer_mut(&mut self) -> &mut Buffer {
cur_buf_mut!(self)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this method, I could add start_undo_group() and end_undo_group() methods to Editor as this is only used to call those methods on Buffer. Not sure if that is better.

@iamcodemaker
Copy link
Contributor Author

Included in #30

@iamcodemaker iamcodemaker deleted the vi3 branch March 26, 2017 02:04
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

Successfully merging this pull request may close these issues.

1 participant