mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't show restore dialog for non-editor dock items
The Nuclide file tree was causing this dialog to be shown every time. With this commit, we exclude non-editor dock items from the "dirty" check.
This commit is contained in:
@@ -901,13 +901,17 @@ class AtomEnvironment extends Model
|
||||
@project.addPath(folder) for folder in projectPaths
|
||||
|
||||
attemptRestoreProjectStateForPaths: (state, projectPaths, filesToOpen = []) ->
|
||||
paneItemIsEmptyUnnamedTextEditor = (item) ->
|
||||
return false unless item instanceof TextEditor
|
||||
return false if item.getPath() or item.isModified()
|
||||
center = @workspace.getCenter()
|
||||
windowIsUnused = =>
|
||||
for container in @workspace.getPaneContainers()
|
||||
for item in container.getPaneItems()
|
||||
if item instanceof TextEditor
|
||||
return false if item.getPath() or item.isModified()
|
||||
else
|
||||
return false if container is center
|
||||
true
|
||||
|
||||
windowIsUnused = @workspace.getPaneItems().every(paneItemIsEmptyUnnamedTextEditor)
|
||||
if windowIsUnused
|
||||
if windowIsUnused()
|
||||
@restoreStateIntoThisEnvironment(state)
|
||||
Promise.all (@workspace.open(file) for file in filesToOpen)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user