     console.log e.selection.getText()
 
   process: ->
+    @pmutex = false
     #Fix pos of external changes
     rshift = 0
     for ec, i in @externalchanges #Shift

      d.dispose()

  internalChange: (e) ->
    for pos in @editor.getCursorBufferPositions()
      @internalchanges.push {'pos': pos, 'text': text}

  externalChange: (e) ->
    lineStartIndex = 0

          @sLines[ec.pos[0]].slice(ec.pos[1])

    @editor.getBuffer().lines = @sLines
    @editor.getBuffer().lineEndings = @sLineEndings
    #Apply internal changes
    for ic in @internalchanges
      @editor.getBuffer().insert(ic.pos, ic.text)

    changes = @internalchanges.slice(0)
    @internalchanges = []
    @externalchanges = []

    #Save state for next round
    @sLines = @editor.getBuffer().getLines()
    @sLineEndings = @editor.getBuffer().lineEndings
    @pmutex = true

    for c, i in changes
      changes[i].pos = changes[i].pos.toArray()

    return changes
