     @disposables = []
     @internalchanges = []
     @externalchanges = []
+    @pmutex = true
+    @icb = []
 
     @disposables.push @editor.onDidInsertText (e) => @internalChange e
     @disposables.push @editor.onDidChangeSelectionRange (e) =>

    console.log e.selection.getText()

  process: ->
    #Fix pos of external changes
    rshift = 0
    for ec, i in @externalchanges #Shift

      d.dispose()

  internalChange: (e) ->
    if @pmutex and @icb.length > 0
      @internalchanges = @icb.concat(@internalchanges)
      @icb = []
    for pos in @editor.getCursorBufferPositions()
      if @pmutex
        @internalchanges.push {'pos': pos, 'text': text}
      else
        @icb.push {'pos': pos, 'text': text}

  externalChange: (e) ->
    lineStartIndex = 0
