       path: @formatPath(path)
 
   localMove: (source, target) ->
-    console.log '>>> 0'
     action: 'local_move'
+    project:
+      path: @formatPath(@projectPath)
+    file:
+      path: @formatPath(target)
+    from: @formatPath(source)
+
+  localDuplicate: (source, target) ->
+    action: 'local_duplicate'
     project:
       path: @formatPath(@projectPath)
     file:

        when 'tree-view:remove' then @onTreeViewRemove(event)

    atom.workspace.observeTextEditors (editor) =>
      editor.onDidSave =>
        @onSave(editor)
      editor.onDidChangePath ->
        console.log 'PATH CHANGED'

    atom.workspace.onDidOpen ({uri, item, pane, index}) ->
      console.log 'OPENED ' + uri

  onSave: (editor) =>
    @convertLineEndings(editor)

    @sendLocalEvent @localAddFile(deepestPath) if fs.isFileSync(deepestPath)
    @sendLocalEvent @localAddFolder(deepestPath) if fs.isDirectorySync(deepestPath)

  syncMoves: =>
    source = @pathAtWillDispatch
    prevEntries = @entriesAtWillDispatch

    return unless @willDispatchCommand is 'tree-view:move'
    @purgeTreeViewEvent()

    return unless source? and prevEntries?

    newEntries = _.difference(fs.listTreeSync(@projectPath), prevEntries)
    return unless newEntries.length

    target = _.max(newEntries, (entry) -> entry.length)
    @sendLocalEvent @localMove(source, target)

  syncDuplication: =>
    source = @pathAtWillDispatch
    prevEntries = @entriesAtWillDispatch

    return unless @willDispatchCommand is 'tree-view:duplicate'
    @purgeTreeViewEvent()

    return unless source? and prevEntries?

    newEntries = _.difference(fs.listTreeSync(@projectPath), prevEntries)
    return unless newEntries.length

    target = _.max(newEntries, (entry) -> entry.length)
    @sendLocalEvent @localDuplicate(source, target)

  sendLocalEvent: (payload) ->
    ipc.send 'fs-local-event', JSON.stringify(payload)
