Creates a Differ instance.
Model's marker collection.
Informs whether there are any changes buffered in Differ.
InternalBuffers all the data related to given root like it was all just added to the editor.
Following changes are buffered:
InternalMarks the given item in differ to be "refreshed". It means that the item will be marked as removed and inserted
in the differ changes set, so it will be effectively re-converted when the differ changes are handled by a dispatcher.
Item to refresh.
Buffers a marker change.
The name of the marker that changed.
Marker data before the change.
Marker data after the change.
Buffers the given operation. An operation has to be buffered before it is executed.
An operation to buffer.
Returns all markers which changed.
Returns all roots that have changed (either were attached, or detached, or their attributes changed).
Diff between the old and the new roots state.
Calculates the diff between the old model tree state (the state before the first buffered operations since the last #reset call) and the new model tree state (actual one). It should be called after all buffered operations are executed.
The diff set is returned as an array of module:engine/model/differ~DifferItem diff items, each describing a change done on the model. The items are sorted by the position on which the change happened. If a position module:engine/model/position~ModelPosition#isBefore is before another one, it will be on an earlier index in the diff set.
Note: Elements inside inserted element will not have a separate diff item, only the top most element change will be reported.
Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the previous #getChanges call, the next call will return the cached value.
Optionaloptions: { includeChangesInGraveyard?: boolean }Additional options.
OptionalincludeChangesInGraveyard?: booleanIf set to true, also changes that happened
in the graveyard root will be returned. By default, changes in the graveyard root are not returned.
Diff between the old and the new model tree state.
Returns all markers which should be added as a result of buffered changes.
Markers to add. Each array item is an object containing the name and range properties.
Returns all markers that should be removed as a result of buffered changes.
Markers to remove. Each array item is an object containing the name and range properties.
Returns a set of model items that were marked to get refreshed.
Checks whether some of the buffered changes affect the editor data.
Types of changes which affect the editor data:
affectsData,affectsData property.Resets Differ. Removes all buffered changes.
Calculates the difference between two model states.
Receives operations that are to be applied on the model document. Marks parts of the model document tree which are changed and saves the state of these elements before the change. Then, it compares saved elements with the changed elements, after all changes are applied on the model document. Calculates the diff between saved elements and new ones and returns a change set.