⬆️ text-buffer@3.7.0 for checkpoints

Also add methods on TextEditor to expose the new checkpoint
functionality
This commit is contained in:
Max Brunsfeld
2014-11-21 11:06:22 -08:00
parent f4cc8c31b3
commit bf83fb7b10
2 changed files with 27 additions and 1 deletions

View File

@@ -1126,6 +1126,32 @@ class TextEditor extends Model
# within the transaction.
abortTransaction: -> @buffer.abortTransaction()
# Experimental: Create a pointer to the current state of the buffer for use
# with {::revertToCheckpoint} and {::groupChangesSinceCheckpoint}.
#
# Returns a checkpoint value.
createCheckpoint: -> @buffer.createCheckpoint()
# Experimental: Revert the buffer to the state it was in when the given
# checkpoint was created.
#
# The redo stack will be empty following this operation, so changes since the
# checkpoint will be lost. If the given checkpoint is no longer present in the
# undo history, no changes will be made to the buffer and this method will
# return `false`.
#
# Returns a {Boolean} indicating whether the operation succeeded.
revertToCheckpoint: (checkpoint) -> @buffer.revertToCheckpoint(checkpoint)
# Experimental: Group all changes since the given checkpoint into a single
# transaction for purposes of undo/redo.
#
# If the given checkpoint is no longer present in the undo history, no
# grouping will be performed and this method will return `false`.
#
# Returns a {Boolean} indicating whether the operation succeeded.
groupChangesSinceCheckpoint: (checkpoint) -> @buffer.groupChangesSinceCheckpoint(checkpoint)
###
Section: TextEditor Coordinates
###