Skip to content

Commit

Permalink
[start] to find parent folder use right file in diff
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekLew committed Jun 24, 2018
1 parent a3cde05 commit 5008209
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/code/electron-main/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export class WindowsManager implements IWindowsMainService {
if (potentialWindowsCount === 0 && (filesToOpen.length > 0 || filesToCreate.length > 0 || filesToDiff.length > 0)) {

// Find suitable window or folder path to open files in
const fileToCheck = filesToOpen[0] || filesToCreate[0] || filesToDiff[0];
const fileToCheck = filesToOpen[0] || filesToCreate[0] || (filesToDiff.length > 1 ? filesToDiff[1] : filesToDiff[0]);

This comment has been minimized.

Copy link
@MarekLew

MarekLew Jun 24, 2018

Author Owner

This have more sense when diff opened in context of editable(second) file.

let bestWindowOrFolder = findBestWindowOrFolderForFile({
windows: WindowsManager.WINDOWS,
newWindow: openFilesInNewWindow,
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/parts/stats/node/workspaceStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ export class WorkspaceStats implements IWorkbenchContribution {
return this.parentURI(URI.file(filesToOpen[0].filePath));
} else if (filesToCreate && filesToCreate.length) {
return this.parentURI(URI.file(filesToCreate[0].filePath));
} else if (filesToDiff && filesToDiff.length) {
return this.parentURI(URI.file(filesToDiff[0].filePath));
} else if (filesToDiff && filesToDiff.length > 1) {
return this.parentURI(URI.file(filesToDiff[1].filePath));

This comment has been minimized.

Copy link
@MarekLew

MarekLew Jun 24, 2018

Author Owner

This have more sense when diff opened in context of editable(second) file.

}
return undefined;
}
Expand Down

0 comments on commit 5008209

Please sign in to comment.