mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Let 'atom --wait -a folder' exit due to removing the project folder
This commit is contained in:
@@ -824,8 +824,15 @@ class AtomEnvironment {
|
||||
this.document.body.appendChild(this.workspace.getElement())
|
||||
if (this.backgroundStylesheet) this.backgroundStylesheet.remove()
|
||||
|
||||
this.disposables.add(this.project.onDidChangePaths(() => {
|
||||
this.applicationDelegate.setRepresentedDirectoryPaths(this.project.getPaths())
|
||||
let previousProjectPaths = this.project.getPaths()
|
||||
this.disposables.add(this.project.onDidChangePaths(newPaths => {
|
||||
for (let path of previousProjectPaths) {
|
||||
if (this.pathsToNotifyWhenClosed.has(path) && !newPaths.includes(path)) {
|
||||
this.applicationDelegate.didCloseInitialPath(path)
|
||||
}
|
||||
}
|
||||
previousProjectPaths = newPaths
|
||||
this.applicationDelegate.setRepresentedDirectoryPaths(newPaths)
|
||||
}))
|
||||
this.disposables.add(this.workspace.onDidDestroyPaneItem(({item}) => {
|
||||
const path = item.getPath && item.getPath()
|
||||
|
||||
@@ -888,6 +888,7 @@ class AtomApplication extends EventEmitter {
|
||||
|
||||
windowDidCloseInitialPath (window, initialPath) {
|
||||
const waitSessions = this.waitSessionsByWindow.get(window)
|
||||
if (!waitSessions) return
|
||||
for (let i = waitSessions.length - 1; i >= 0; i--) {
|
||||
const session = waitSessions[i]
|
||||
session.remainingPaths.delete(initialPath)
|
||||
|
||||
Reference in New Issue
Block a user