     snapshotBelow = null
     spliceIndex = null
     withinGroup = false
-    patch = new Patch
+    patch = null
 
     for entry, i in @undoStack by -1
       break if spliceIndex?

Patch = require 'atom-patch'

SerializationVersion = 3

buildPatchFromChange = (change) ->
  {
    getChanges: ->
      [{
        oldStart: change.newStart,
        newStart: change.newStart,
        oldExtent: change.oldExtent,
        newExtent: change.newExtent,
        oldText: change.oldText,
        newText: change.newText
      }]
  }

class Checkpoint
  constructor: (@id, @snapshot, @isBoundary) ->

          if entry.isBoundary
            return false
        else
          patch = Patch.invert(entry)
          unless withinGroup
            spliceIndex = i

