提交 cb845480 编写于 作者: B Benjamin Pasero

Win/Linux: allow window.openFilesInNewWindow:default (for #48)

上级 526c5c03
......@@ -981,10 +981,22 @@ export class WindowsManager implements IWindowsMainService {
if (openConfig.forceNewWindow || openConfig.forceReuseWindow) {
openFilesInNewWindow = openConfig.forceNewWindow && !openConfig.forceReuseWindow;
} else {
if (openConfig.context === OpenContext.DOCK) {
openFilesInNewWindow = true; // only on macOS do we allow to open files in a new window if this is triggered via DOCK context
// macOS: by default we open files in a new window if this is triggered via DOCK context
if (isMacintosh) {
if (openConfig.context === OpenContext.DOCK) {
openFilesInNewWindow = true;
}
}
// Linux/Windows: by default we open files in the new window unless triggered via DIALOG or MENU context
else {
if (openConfig.context !== OpenContext.DIALOG && openConfig.context !== OpenContext.MENU) {
openFilesInNewWindow = true;
}
}
// finally check for overrides of default
if (!openConfig.cli.extensionDevelopmentPath && (openFilesInNewWindowConfig === 'on' || openFilesInNewWindowConfig === 'off')) {
openFilesInNewWindow = (openFilesInNewWindowConfig === 'on');
}
......
......@@ -293,11 +293,16 @@ configurationRegistry.registerConfiguration({
'enumDescriptions': [
nls.localize('window.openFilesInNewWindow.on', "Files will open in a new window"),
nls.localize('window.openFilesInNewWindow.off', "Files will open in the window with the files' folder open or the last active window"),
nls.localize('window.openFilesInNewWindow.default', "Files will open in the window with the files' folder open or the last active window unless opened via the dock or from finder (macOS only)")
isMacintosh ?
nls.localize('window.openFilesInNewWindow.defaultMac', "Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder") :
nls.localize('window.openFilesInNewWindow.default', "Files will open in a new window unless picked from within the application (e.g. via the File menu)")
],
'default': 'off',
'description':
nls.localize('openFilesInNewWindow', "Controls if files should open in a new window.\n- default: files will open in the window with the files' folder open or the last active window unless opened via the dock or from finder (macOS only)\n- on: files will open in a new window\n- off: files will open in the window with the files' folder open or the last active window\nNote that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).")
isMacintosh ?
nls.localize('openFilesInNewWindowMac', "Controls if files should open in a new window.\n- default: files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder\n- on: files will open in a new window\n- off: files will open in the window with the files' folder open or the last active window\nNote 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.\n- default: files will open in a new window unless picked from within the application (e.g. via the File menu)\n- on: files will open in a new window\n- off: files will open in the window with the files' folder open or the last active window\nNote 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': 'string',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册