mirror of
https://github.com/atom/atom.git
synced 2026-02-14 00:25:08 -05:00
⬆️ text-buffer@3.7.0 for checkpoints
Also add methods on TextEditor to expose the new checkpoint functionality
This commit is contained in:
@@ -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
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user