Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add checkpoints as a replacement for open-ended transactions #38

Merged
merged 4 commits into from
Nov 21, 2014

Conversation

nathansobo
Copy link
Contributor

Refs #39

The beginTransaction method is causing big problems because it allows transactions to be left open. Nested transactions also behave unpredictably. For example, we use beginTransaction and commitTransaction in vim-mode to group multiple changes in insert mode. This conflicts with our use of beginTransaction and abortTransaction in the autocomplete to clear away transient changes that occurred when user toggled through completions after the menu is dismissed.

Checkpoints provide a much more controlled mechanism for addressing these two use cases. You can create a checkpoint at a desired state, then later either revert the buffer to the checkpoint (autocomplete) or group the changes since that checkpoint in a single transaction (vim-mode).

maxbrunsfeld and others added 3 commits November 20, 2014 14:02
Signed-off-by: Nathan Sobo <nathan@github.com>
This groups all changes since the given checkpoint into a single
transaction on the undo history, which will be used to batch together
a set of changes after vim-mode exits insert mode.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
maxbrunsfeld added a commit that referenced this pull request Nov 21, 2014
Add checkpoints as a replacement for open-ended transactions
@maxbrunsfeld maxbrunsfeld merged commit 71cb91b into master Nov 21, 2014
@maxbrunsfeld maxbrunsfeld deleted the checkpoints branch November 21, 2014 19:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants