Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
69786b2c
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
69786b2c
编写于
6月 01, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - close all groups should preserve first group
上级
ba8c0a87
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
26 addition
and
10 deletion
+26
-10
src/vs/workbench/browser/parts/editor/editorActions.ts
src/vs/workbench/browser/parts/editor/editorActions.ts
+24
-9
src/vs/workbench/browser/parts/editor/editorCommands.ts
src/vs/workbench/browser/parts/editor/editorCommands.ts
+2
-1
未找到文件。
src/vs/workbench/browser/parts/editor/editorActions.ts
浏览文件 @
69786b2c
...
@@ -20,7 +20,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
...
@@ -20,7 +20,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
CLOSE_EDITOR_COMMAND_ID
,
NAVIGATE_ALL_EDITORS_GROUP_PREFIX
,
MOVE_ACTIVE_EDITOR_COMMAND_ID
,
NAVIGATE_IN_ACTIVE_GROUP_PREFIX
,
ActiveEditorMoveArguments
,
SPLIT_EDITOR_LEFT
,
SPLIT_EDITOR_RIGHT
,
SPLIT_EDITOR_UP
,
SPLIT_EDITOR_DOWN
,
splitEditor
,
LAYOUT_EDITOR_GROUPS_COMMAND_ID
,
mergeAllGroups
}
from
'
vs/workbench/browser/parts/editor/editorCommands
'
;
import
{
CLOSE_EDITOR_COMMAND_ID
,
NAVIGATE_ALL_EDITORS_GROUP_PREFIX
,
MOVE_ACTIVE_EDITOR_COMMAND_ID
,
NAVIGATE_IN_ACTIVE_GROUP_PREFIX
,
ActiveEditorMoveArguments
,
SPLIT_EDITOR_LEFT
,
SPLIT_EDITOR_RIGHT
,
SPLIT_EDITOR_UP
,
SPLIT_EDITOR_DOWN
,
splitEditor
,
LAYOUT_EDITOR_GROUPS_COMMAND_ID
,
mergeAllGroups
}
from
'
vs/workbench/browser/parts/editor/editorCommands
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupsArrangement
,
EditorsOrder
,
GroupLocation
,
GroupDirection
,
preferredSideBySideGroupDirection
,
IFindGroupScope
,
GroupOrientation
,
EditorGroupLayout
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupsArrangement
,
EditorsOrder
,
GroupLocation
,
GroupDirection
,
preferredSideBySideGroupDirection
,
IFindGroupScope
,
GroupOrientation
,
EditorGroupLayout
,
GroupsOrder
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IEditorService
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorService
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
...
@@ -555,11 +555,26 @@ export abstract class BaseCloseAllAction extends Action {
...
@@ -555,11 +555,26 @@ export abstract class BaseCloseAllAction extends Action {
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
clazz
:
string
,
clazz
:
string
,
private
textFileService
:
ITextFileService
private
textFileService
:
ITextFileService
,
protected
editorGroupService
:
IEditorGroupsService
)
{
)
{
super
(
id
,
label
,
clazz
);
super
(
id
,
label
,
clazz
);
}
}
protected
get
groupsToClose
():
IEditorGroup
[]
{
const
groupsToClose
:
IEditorGroup
[]
=
[];
// Close editors in reverse order of their grid appearance so that the editor
// group that is the first (top-left) remains. This helps to keep view state
// for editors around that have been opened in this visually first group.
const
groups
=
this
.
editorGroupService
.
getGroups
(
GroupsOrder
.
GRID_APPEARANCE
);
for
(
let
i
=
groups
.
length
-
1
;
i
>=
0
;
i
--
)
{
groupsToClose
.
push
(
groups
[
i
]);
}
return
groupsToClose
;
}
public
run
():
TPromise
<
any
>
{
public
run
():
TPromise
<
any
>
{
// Just close all if there are no or one dirty editor
// Just close all if there are no or one dirty editor
...
@@ -602,13 +617,13 @@ export class CloseAllEditorsAction extends BaseCloseAllAction {
...
@@ -602,13 +617,13 @@ export class CloseAllEditorsAction extends BaseCloseAllAction {
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
IEditorGroupsService
private
editorGroupService
:
IEditorGroupsService
@
IEditorGroupsService
editorGroupService
:
IEditorGroupsService
)
{
)
{
super
(
id
,
label
,
'
action-close-all-files
'
,
textFileService
);
super
(
id
,
label
,
'
action-close-all-files
'
,
textFileService
,
editorGroupService
);
}
}
protected
doCloseAll
():
TPromise
<
any
>
{
protected
doCloseAll
():
TPromise
<
any
>
{
return
TPromise
.
join
(
this
.
editorGroupService
.
groups
.
map
(
g
=>
g
.
closeAllEditors
()));
return
TPromise
.
join
(
this
.
groupsToClose
.
map
(
g
=>
g
.
closeAllEditors
()));
}
}
}
}
...
@@ -621,14 +636,14 @@ export class CloseAllEditorGroupsAction extends BaseCloseAllAction {
...
@@ -621,14 +636,14 @@ export class CloseAllEditorGroupsAction extends BaseCloseAllAction {
id
:
string
,
id
:
string
,
label
:
string
,
label
:
string
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
ITextFileService
textFileService
:
ITextFileService
,
@
IEditorGroupsService
private
editorGroupService
:
IEditorGroupsService
@
IEditorGroupsService
editorGroupService
:
IEditorGroupsService
)
{
)
{
super
(
id
,
label
,
void
0
,
textFileService
);
super
(
id
,
label
,
void
0
,
textFileService
,
editorGroupService
);
}
}
protected
doCloseAll
():
TPromise
<
any
>
{
protected
doCloseAll
():
TPromise
<
any
>
{
return
TPromise
.
join
(
this
.
editorGroupService
.
groups
.
map
(
g
=>
g
.
closeAllEditors
())).
then
(()
=>
{
return
TPromise
.
join
(
this
.
groupsToClose
.
map
(
g
=>
g
.
closeAllEditors
())).
then
(()
=>
{
this
.
editorGroupService
.
groups
.
forEach
(
group
=>
this
.
editorGroupService
.
removeGroup
(
group
));
this
.
groupsToClose
.
forEach
(
group
=>
this
.
editorGroupService
.
removeGroup
(
group
));
});
});
}
}
}
}
...
...
src/vs/workbench/browser/parts/editor/editorCommands.ts
浏览文件 @
69786b2c
...
@@ -205,7 +205,8 @@ function registerEditorGroupsLayoutCommand(): void {
...
@@ -205,7 +205,8 @@ function registerEditorGroupsLayoutCommand(): void {
});
});
}
}
export
function
mergeAllGroups
(
editorGroupService
:
IEditorGroupsService
,
target
=
editorGroupService
.
groups
[
0
]):
void
{
export
function
mergeAllGroups
(
editorGroupService
:
IEditorGroupsService
):
void
{
const
target
=
editorGroupService
.
activeGroup
;
editorGroupService
.
groups
.
forEach
(
group
=>
{
editorGroupService
.
groups
.
forEach
(
group
=>
{
if
(
group
===
target
)
{
if
(
group
===
target
)
{
return
;
// keep target
return
;
// keep target
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录