提交 31042a91 编写于 作者: B Benjamin Pasero

turn openFoldersInNewWindow and openFilesInNewWindow into an enum and explain behaviour

上级 39550489
......@@ -374,8 +374,8 @@ export class WindowsManager implements IWindowsMainService {
// let the user settings override how folders are open in a new window or same window unless we are forced
let openFolderInNewWindow = (openConfig.preferNewWindow || openConfig.forceNewWindow) && !openConfig.forceReuseWindow;
if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && windowConfig && typeof windowConfig.openFoldersInNewWindow === 'boolean') {
openFolderInNewWindow = windowConfig.openFoldersInNewWindow;
if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && windowConfig && (windowConfig.openFoldersInNewWindow === 'on' || windowConfig.openFoldersInNewWindow === 'off')) {
openFolderInNewWindow = (windowConfig.openFoldersInNewWindow === 'on');
}
// Handle files to open/diff or to create when we dont open a folder
......@@ -390,8 +390,8 @@ export class WindowsManager implements IWindowsMainService {
openFilesInNewWindow = true; // only on macOS do we allow to open files in a new window if this is triggered via DOCK context
}
if (!openConfig.cli.extensionDevelopmentPath && windowConfig && typeof windowConfig.openFilesInNewWindow === 'boolean') {
openFilesInNewWindow = windowConfig.openFilesInNewWindow;
if (!openConfig.cli.extensionDevelopmentPath && windowConfig && (windowConfig.openFilesInNewWindow === 'on' || windowConfig.openFilesInNewWindow === 'off')) {
openFilesInNewWindow = (windowConfig.openFilesInNewWindow === 'on');
}
}
......
......@@ -87,8 +87,8 @@ export interface IWindowService {
}
export interface IWindowSettings {
openFilesInNewWindow: boolean;
openFoldersInNewWindow: boolean;
openFilesInNewWindow: 'on' | 'off' | 'default';
openFoldersInNewWindow: 'on' | 'off' | 'default';
reopenFolders: 'all' | 'one' | 'none';
restoreFullscreen: boolean;
zoomLevel: number;
......
......@@ -171,14 +171,36 @@ configurationRegistry.registerConfiguration({
// Configuration: Window
let properties: { [path: string]: IJSONSchema; } = {
'window.openFilesInNewWindow': {
'type': 'boolean',
'default': false,
'description': nls.localize('openFilesInNewWindow', "When enabled, will prefer to open files in a new window instead of reusing an existing instance. Note that there can still be cases where this setting is ignored (e.g. when using the -n command line option).")
'type': 'string',
'enum': ['on', 'off', 'default'],
'default': 'default',
'description': platform.isMacintosh ?
nls.localize('openFilesInNewWindowMac',
`Controls if files should open in a new window or the last active window.
- default: files will open in the last active window unless opened via the dock or from finder
- on: files will open in a new window
- off: files will open in the last active window
Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).`
) :
nls.localize('openFilesInNewWindow',
`Controls if files should open in a new window or the last active window.
- default: files will open in the last active window
- on: files will open in a new window
- off: files will open in the last active window
Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).`
)
},
'window.openFoldersInNewWindow': {
'type': 'boolean',
'default': false,
'description': nls.localize('openFoldersInNewWindow', "When enabled, will prefer to open folders in a new window instead of reusing an existing instance. Note that there can still be cases where this setting is ignored (e.g. when using the -n command line option).")
'type': 'string',
'enum': ['on', 'off', 'default'],
'default': 'default',
'description': nls.localize('openFoldersInNewWindow',
`Controls if folders should open in a new window or the last active window.
- default: folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu)
- on: folders will open in a new window
- off: folders will open in the last active window
Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).`
)
},
'window.reopenFolders': {
'type': 'string',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册