Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d2ac0ce6
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,发现更多精彩内容 >>
未验证
提交
d2ac0ce6
编写于
8月 15, 2018
作者:
B
Benjamin Pasero
提交者:
GitHub
8月 15, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Open Editors: revisit order of groups to be based on visual order (for #56084) (#56264)
上级
2959c851
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
16 deletion
+29
-16
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+24
-11
src/vs/workbench/browser/parts/editor/editorPicker.ts
src/vs/workbench/browser/parts/editor/editorPicker.ts
+2
-2
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
...nch/parts/files/electron-browser/views/openEditorsView.ts
+3
-3
未找到文件。
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
d2ac0ce6
...
...
@@ -419,13 +419,16 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
// Mark preferred size as changed
this
.
resetPreferredSize
();
// Events for group
d
that got added
// Events for group
s
that got added
this
.
getGroups
(
GroupsOrder
.
GRID_APPEARANCE
).
forEach
(
groupView
=>
{
if
(
currentGroupViews
.
indexOf
(
groupView
)
===
-
1
)
{
this
.
_onDidAddGroup
.
fire
(
groupView
);
}
});
// Update labels
this
.
updateGroupLabels
();
// Restore focus as needed
if
(
gridHasFocus
)
{
this
.
_activeGroup
.
focus
();
...
...
@@ -475,6 +478,9 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
// Event
this
.
_onDidAddGroup
.
fire
(
newGroupView
);
// Update labels
this
.
updateGroupLabels
();
return
newGroupView
;
}
...
...
@@ -631,12 +637,8 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
this
.
_activeGroup
.
focus
();
}
// Update labels: since our labels are created using the index of the
// group, removing a group might produce gaps. So we iterate over all
// groups and reassign the label based on the index.
this
.
getGroups
(
GroupsOrder
.
CREATION_TIME
).
forEach
((
group
,
index
)
=>
{
group
.
setLabel
(
this
.
getGroupLabel
(
index
+
1
));
});
// Update labels
this
.
updateGroupLabels
();
// Update container
this
.
updateContainer
();
...
...
@@ -648,10 +650,6 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
this
.
_onDidRemoveGroup
.
fire
(
groupView
);
}
private
getGroupLabel
(
index
:
number
):
string
{
return
localize
(
'
groupLabel
'
,
"
Group {0}
"
,
index
);
}
moveGroup
(
group
:
IEditorGroupView
|
GroupIdentifier
,
location
:
IEditorGroupView
|
GroupIdentifier
,
direction
:
GroupDirection
):
IEditorGroupView
{
const
sourceView
=
this
.
assertGroupView
(
group
);
const
targetView
=
this
.
assertGroupView
(
location
);
...
...
@@ -887,6 +885,21 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
toggleClass
(
this
.
container
,
'
empty
'
,
this
.
isEmpty
());
}
private
updateGroupLabels
():
void
{
// Since our labels are created using the index of the
// group, adding/removing a group might produce gaps.
// So we iterate over all groups and reassign the label
// based on the index.
this
.
getGroups
(
GroupsOrder
.
GRID_APPEARANCE
).
forEach
((
group
,
index
)
=>
{
group
.
setLabel
(
this
.
getGroupLabel
(
index
+
1
));
});
}
private
getGroupLabel
(
index
:
number
):
string
{
return
localize
(
'
groupLabel
'
,
"
Group {0}
"
,
index
);
}
private
isEmpty
():
boolean
{
return
this
.
groupViews
.
size
===
1
&&
this
.
_activeGroup
.
isEmpty
();
}
...
...
src/vs/workbench/browser/parts/editor/editorPicker.ts
浏览文件 @
d2ac0ce6
...
...
@@ -117,7 +117,7 @@ export abstract class BaseEditorPicker extends QuickOpenHandler {
// Sorting
if
(
query
.
value
)
{
const
groups
=
this
.
editorGroupService
.
getGroups
(
GroupsOrder
.
CREATION_TIM
E
);
const
groups
=
this
.
editorGroupService
.
getGroups
(
GroupsOrder
.
GRID_APPEARANC
E
);
entries
.
sort
((
e1
,
e2
)
=>
{
if
(
e1
.
group
!==
e2
.
group
)
{
return
groups
.
indexOf
(
e1
.
group
)
-
groups
.
indexOf
(
e2
.
group
);
// older groups first
...
...
@@ -206,7 +206,7 @@ export class AllEditorsPicker extends BaseEditorPicker {
protected
getEditorEntries
():
EditorPickerEntry
[]
{
const
entries
:
EditorPickerEntry
[]
=
[];
this
.
editorGroupService
.
getGroups
(
GroupsOrder
.
CREATION_TIM
E
).
forEach
(
group
=>
{
this
.
editorGroupService
.
getGroups
(
GroupsOrder
.
GRID_APPEARANC
E
).
forEach
(
group
=>
{
group
.
editors
.
forEach
(
editor
=>
{
entries
.
push
(
this
.
instantiationService
.
createInstance
(
EditorPickerEntry
,
editor
,
group
));
});
...
...
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
浏览文件 @
d2ac0ce6
...
...
@@ -10,7 +10,7 @@ import { IAction, ActionRunner } from 'vs/base/common/actions';
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupChangeKind
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IEditorGroupsService
,
IEditorGroup
,
GroupChangeKind
,
GroupsOrder
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IConfigurationService
,
IConfigurationChangeEvent
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IEditorInput
}
from
'
vs/workbench/common/editor
'
;
...
...
@@ -326,7 +326,7 @@ export class OpenEditorsView extends ViewletPanel {
private
get
elements
():
(
IEditorGroup
|
OpenEditor
)[]
{
const
result
:
(
IEditorGroup
|
OpenEditor
)[]
=
[];
this
.
editorGroupService
.
g
roups
.
forEach
(
g
=>
{
this
.
editorGroupService
.
g
etGroups
(
GroupsOrder
.
GRID_APPEARANCE
)
.
forEach
(
g
=>
{
if
(
this
.
showGroups
)
{
result
.
push
(
g
);
}
...
...
@@ -342,7 +342,7 @@ export class OpenEditorsView extends ViewletPanel {
return
index
;
}
for
(
let
g
of
this
.
editorGroupService
.
g
roups
)
{
for
(
let
g
of
this
.
editorGroupService
.
g
etGroups
(
GroupsOrder
.
GRID_APPEARANCE
)
)
{
if
(
g
.
id
===
group
.
id
)
{
return
index
+
(
!!
editor
?
1
:
0
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录