Changes moveViews command to "preserve" view state

When you move views via the command, they won't get expanded or made visible

Co-authored-by: SteVen Batten <stbatt@microsoft.com>
This commit is contained in:
Eric Amodio
2020-09-23 19:15:25 -04:00
parent 366f97bad4
commit a1932df627
3 changed files with 57 additions and 48 deletions

View File

@@ -16,7 +16,7 @@ import { IWorkspacesService, hasWorkspaceFileExtension, IRecent } from 'vs/platf
import { Schemas } from 'vs/base/common/network';
import { ILogService } from 'vs/platform/log/common/log';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IViewDescriptorService, IViewsService } from 'vs/workbench/common/views';
import { IViewDescriptorService, IViewsService, ViewVisibilityState } from 'vs/workbench/common/views';
// -----------------------------------------------------------------
// The following commands are registered on both sides separately.
@@ -279,7 +279,7 @@ CommandsRegistry.registerCommand('_workbench.action.moveViews', async function (
for (const viewId of options.viewIds) {
const viewDescriptor = viewDescriptorService.getViewDescriptorById(viewId);
if (viewDescriptor?.canMoveView) {
viewDescriptorService.moveViewsToContainer([viewDescriptor], destination);
viewDescriptorService.moveViewsToContainer([viewDescriptor], destination, ViewVisibilityState.Default);
}
}