           if entry.isBoundary
             return false
         else
-          for {oldStart, oldExtent, newExtent, oldText, newText} in entry.getChanges()
-            patch.splice(oldStart, newExtent, oldExtent, {oldText: newText, newText: oldText})
+          patch = Patch.invert(entry)
           unless withinGroup
             spliceIndex = i
 

    snapshotBelow = null
    spliceIndex = null
    withinGroup = false
    patch = new Patch

    for entry, i in @undoStack by -1
      break if spliceIndex?

    throw new Error("Didn't find matching group-start entry")

  pushChange: (change) ->
    @undoStack.push(Patch.withSingleChange(change))
    @clearRedoStack()

    if @undoStack.length - @maxUndoEntries > 0
