add gotoLineMode to IOpenSettings

This commit is contained in:
Martin Aeschlimann
2019-07-18 16:56:08 +02:00
parent 034e0a9f99
commit 6163b86243
8 changed files with 18 additions and 10 deletions

View File

@@ -241,6 +241,7 @@ export class CodeApplication extends Disposable {
context: OpenContext.DOCK /* can also be opening from finder while app is running */,
cli: this.environmentService.args,
urisToOpen: macOpenFileURIs,
gotoLineMode: false,
preferNewWindow: true /* dropping on the dock or opening from finder prefers to open in a new window */
});
@@ -595,8 +596,8 @@ export class CodeApplication extends Disposable {
urlService.registerHandler({
async handleURL(uri: URI): Promise<boolean> {
if (windowsMainService.getWindowCount() === 0) {
const cli = { ...environmentService.args, goto: true };
const [window] = windowsMainService.open({ context: OpenContext.API, cli, forceEmpty: true });
const cli = { ...environmentService.args };
const [window] = windowsMainService.open({ context: OpenContext.API, cli, forceEmpty: true, gotoLineMode: true });
await window.ready();
@@ -647,6 +648,7 @@ export class CodeApplication extends Disposable {
urisToOpen: macOpenFiles.map(file => this.getURIToOpenFromPathSync(file)),
noRecentEntry,
waitMarkerFileURI,
gotoLineMode: false,
initialStartup: true
});
}
@@ -659,6 +661,7 @@ export class CodeApplication extends Disposable {
diffMode: args.diff,
noRecentEntry,
waitMarkerFileURI,
gotoLineMode: args.goto,
initialStartup: true
});
}

View File

@@ -844,8 +844,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
private doExtractPathsFromAPI(openConfig: IOpenConfiguration): IPathToOpen[] {
const pathsToOpen: IPathToOpen[] = [];
const cli = openConfig.cli;
const parseOptions: IPathParseOptions = { gotoLineMode: cli && cli.goto };
const parseOptions: IPathParseOptions = { gotoLineMode: openConfig.gotoLineMode };
for (const pathToOpen of openConfig.urisToOpen || []) {
if (!pathToOpen) {
continue;