mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
Re-use an existing window if one is available that contains all paths
This commit is contained in:
@@ -878,13 +878,14 @@ class AtomApplication extends EventEmitter {
|
||||
const normalizedPathsToOpen = locationsToOpen.map(location => location.pathToOpen).filter(Boolean)
|
||||
|
||||
let existingWindow
|
||||
if (addToLastWindow && normalizedPathsToOpen.length > 0) {
|
||||
if (!newWindow && normalizedPathsToOpen.length > 0) {
|
||||
existingWindow = this.windowForPaths(normalizedPathsToOpen, devMode)
|
||||
if (!existingWindow) {
|
||||
let lastWindow = window || this.getLastFocusedWindow()
|
||||
if (lastWindow && lastWindow.devMode === devMode) {
|
||||
existingWindow = lastWindow
|
||||
}
|
||||
}
|
||||
|
||||
if (addToLastWindow && !existingWindow) {
|
||||
let lastWindow = window || this.getLastFocusedWindow()
|
||||
if (lastWindow && lastWindow.devMode === devMode) {
|
||||
existingWindow = lastWindow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user