Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Use new hooks for updating editors
Browse files Browse the repository at this point in the history
  • Loading branch information
Michelle Tilley committed Mar 25, 2017
1 parent b17769f commit b5d228d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/tree-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class TreeView
@disposables.add @onEntryMoved ({initialPath, newPath}) ->
updateEditorsForPath(initialPath, newPath)

@disposables.add @onEntryDeleted ({path}) ->
for editor in atom.workspace.getTextEditors()
if editor?.getPath()?.startsWith(path)
editor.destroy()

serialize: ->
directoryExpansionStates: new ((roots) ->
@[root.directory.path] = root.directory.serializeExpansionState() for root in roots
Expand Down Expand Up @@ -630,9 +635,6 @@ class TreeView
for selectedPath in selectedPaths
if shell.moveItemToTrash(selectedPath)
@emitter.emit 'entry-deleted', {path: selectedPath}
for editor in atom.workspace.getTextEditors()
if editor?.getPath()?.startsWith(selectedPath)
editor.destroy()
else
failedDeletions.push "#{selectedPath}"
if repo = repoForPath(selectedPath)
Expand Down

0 comments on commit b5d228d

Please sign in to comment.