Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7352ad52
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,发现更多精彩内容 >>
提交
7352ad52
编写于
10月 17, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename positions (one, two, three)
上级
81a9436b
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
252 addition
and
251 deletion
+252
-251
src/vs/platform/editor/common/editor.ts
src/vs/platform/editor/common/editor.ts
+7
-7
src/vs/workbench/browser/actions/openSettings.ts
src/vs/workbench/browser/actions/openSettings.ts
+4
-4
src/vs/workbench/browser/parts/editor/editorActions.ts
src/vs/workbench/browser/parts/editor/editorActions.ts
+37
-37
src/vs/workbench/browser/parts/editor/editorCommands.ts
src/vs/workbench/browser/parts/editor/editorCommands.ts
+3
-3
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+30
-30
src/vs/workbench/browser/parts/editor/editorPicker.ts
src/vs/workbench/browser/parts/editor/editorPicker.ts
+3
-3
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
...workbench/browser/parts/editor/sideBySideEditorControl.ts
+158
-158
src/vs/workbench/electron-browser/integration.ts
src/vs/workbench/electron-browser/integration.ts
+1
-1
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+2
-1
src/vs/workbench/parts/extensions/electron-browser/dependenciesViewer.ts
...h/parts/extensions/electron-browser/dependenciesViewer.ts
+1
-1
src/vs/workbench/parts/files/browser/fileActions.ts
src/vs/workbench/parts/files/browser/fileActions.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts
...rkbench/parts/files/electron-browser/dirtyFilesTracker.ts
+1
-1
src/vs/workbench/test/browser/services.test.ts
src/vs/workbench/test/browser/services.test.ts
+1
-1
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
...vs/workbench/test/common/editor/editorStacksModel.test.ts
+3
-3
未找到文件。
src/vs/platform/editor/common/editor.ts
浏览文件 @
7352ad52
...
...
@@ -111,17 +111,17 @@ export interface IEditor {
*/
export
enum
Position
{
/** Opens the editor in the
LEFT mo
st position replacing the input currently showing */
LEFT
=
0
,
/** Opens the editor in the
fir
st position replacing the input currently showing */
ONE
=
0
,
/** Opens the editor in the
CENTER
position replacing the input currently showing */
CENTER
=
1
,
/** Opens the editor in the
second
position replacing the input currently showing */
TWO
=
1
,
/** Opens the editor in the
RIGHT
most position replacing the input currently showing */
RIGHT
=
2
/** Opens the editor in the
third
most position replacing the input currently showing */
THREE
=
2
}
export
const
POSITIONS
=
[
Position
.
LEFT
,
Position
.
CENTER
,
Position
.
RIGHT
];
export
const
POSITIONS
=
[
Position
.
ONE
,
Position
.
TWO
,
Position
.
THREE
];
export
enum
Direction
{
LEFT
,
...
...
src/vs/workbench/browser/actions/openSettings.ts
浏览文件 @
7352ad52
...
...
@@ -74,12 +74,12 @@ export class BaseTwoEditorsAction extends Action {
return
this
.
createIfNotExists
(
editableResource
,
defaultEditableContents
).
then
(()
=>
{
return
this
.
editorService
.
createInput
({
resource
:
editableResource
}).
then
(
typedRightHandEditableInput
=>
{
const
editors
=
[
{
input
:
leftHandDefaultInput
,
position
:
Position
.
LEFT
,
options
:
{
pinned
:
true
}
},
{
input
:
typedRightHandEditableInput
,
position
:
Position
.
CENTER
,
options
:
{
pinned
:
true
}
}
{
input
:
leftHandDefaultInput
,
position
:
Position
.
ONE
,
options
:
{
pinned
:
true
}
},
{
input
:
typedRightHandEditableInput
,
position
:
Position
.
TWO
,
options
:
{
pinned
:
true
}
}
];
return
this
.
editorService
.
openEditors
(
editors
).
then
(()
=>
{
this
.
editorGroupService
.
focusGroup
(
Position
.
CENTER
);
this
.
editorGroupService
.
focusGroup
(
Position
.
TWO
);
});
});
});
...
...
@@ -153,7 +153,7 @@ export class OpenGlobalSettingsAction extends BaseOpenSettingsAction {
const
editorCount
=
this
.
editorService
.
getVisibleEditors
().
length
;
return
this
.
editorService
.
createInput
({
resource
:
this
.
contextService
.
toResource
(
WORKSPACE_CONFIG_DEFAULT_PATH
)
}).
then
(
typedInput
=>
{
return
this
.
editorService
.
openEditor
(
typedInput
,
{
pinned
:
true
},
editorCount
===
2
?
Position
.
RIGHT
:
editorCount
===
1
?
Position
.
CENTER
:
void
0
);
return
this
.
editorService
.
openEditor
(
typedInput
,
{
pinned
:
true
},
editorCount
===
2
?
Position
.
THREE
:
editorCount
===
1
?
Position
.
TWO
:
void
0
);
});
}),
new
Action
(
'
neverShowAgain
'
,
nls
.
localize
(
'
neverShowAgain
'
,
"
Don't show again
"
),
null
,
true
,
()
=>
{
...
...
src/vs/workbench/browser/parts/editor/editorActions.ts
浏览文件 @
7352ad52
...
...
@@ -72,24 +72,24 @@ export class SplitEditorAction extends Action {
// Open split editor to the right of left one
case
1
:
targetPosition
=
Position
.
CENTER
;
targetPosition
=
Position
.
TWO
;
break
;
// Special case two editors opened
case
2
:
// Continue splitting to the right
if
(
editorToSplit
.
position
===
Position
.
CENTER
)
{
targetPosition
=
Position
.
RIGHT
;
if
(
editorToSplit
.
position
===
Position
.
TWO
)
{
targetPosition
=
Position
.
THREE
;
}
// Push the center group to the right to make room for the splitted input
else
if
(
editorToSplit
.
position
===
Position
.
LEFT
)
{
else
if
(
editorToSplit
.
position
===
Position
.
ONE
)
{
options
.
preserveFocus
=
true
;
return
this
.
editorService
.
openEditor
(
editorToSplit
.
input
,
options
,
Position
.
RIGHT
).
then
(()
=>
{
this
.
editorGroupService
.
moveGroup
(
Position
.
RIGHT
,
Position
.
CENTER
);
this
.
editorGroupService
.
focusGroup
(
Position
.
CENTER
);
return
this
.
editorService
.
openEditor
(
editorToSplit
.
input
,
options
,
Position
.
THREE
).
then
(()
=>
{
this
.
editorGroupService
.
moveGroup
(
Position
.
THREE
,
Position
.
TWO
);
this
.
editorGroupService
.
focusGroup
(
Position
.
TWO
);
});
}
}
...
...
@@ -179,8 +179,8 @@ export class FocusFirstGroupAction extends Action {
// Find left editor and focus it
const
editors
=
this
.
editorService
.
getVisibleEditors
();
for
(
let
editor
of
editors
)
{
if
(
editor
.
position
===
Position
.
LEFT
)
{
this
.
editorGroupService
.
focusGroup
(
Position
.
LEFT
);
if
(
editor
.
position
===
Position
.
ONE
)
{
this
.
editorGroupService
.
focusGroup
(
Position
.
ONE
);
return
TPromise
.
as
(
true
);
}
...
...
@@ -193,10 +193,10 @@ export class FocusFirstGroupAction extends Action {
// For now only support to open files from history to the side
if
(
input
instanceof
EditorInput
)
{
if
(
!!
getUntitledOrFileResource
(
input
))
{
return
this
.
editorService
.
openEditor
(
input
,
null
,
Position
.
LEFT
);
return
this
.
editorService
.
openEditor
(
input
,
null
,
Position
.
ONE
);
}
}
else
{
return
this
.
editorService
.
openEditor
(
input
as
IResourceInput
,
Position
.
LEFT
);
return
this
.
editorService
.
openEditor
(
input
as
IResourceInput
,
Position
.
ONE
);
}
}
...
...
@@ -293,11 +293,11 @@ export class FocusSecondGroupAction extends BaseFocusSideGroupAction {
}
protected
getReferenceEditorSide
():
Position
{
return
Position
.
LEFT
;
return
Position
.
ONE
;
}
protected
getTargetEditorSide
():
Position
{
return
Position
.
CENTER
;
return
Position
.
TWO
;
}
}
...
...
@@ -317,11 +317,11 @@ export class FocusThirdGroupAction extends BaseFocusSideGroupAction {
}
protected
getReferenceEditorSide
():
Position
{
return
Position
.
CENTER
;
return
Position
.
TWO
;
}
protected
getTargetEditorSide
():
Position
{
return
Position
.
RIGHT
;
return
Position
.
THREE
;
}
}
...
...
@@ -349,9 +349,9 @@ export class FocusPreviousGroup extends Action {
// Find the next position to the left
let
nextPosition
:
Position
=
Position
.
LEFT
;
if
(
activeEditor
.
position
===
Position
.
RIGHT
)
{
nextPosition
=
Position
.
CENTER
;
let
nextPosition
:
Position
=
Position
.
ONE
;
if
(
activeEditor
.
position
===
Position
.
THREE
)
{
nextPosition
=
Position
.
TWO
;
}
// Focus next position if provided
...
...
@@ -377,9 +377,9 @@ export class FocusNextGroup extends Action {
super
(
id
,
label
);
this
.
navigateActions
=
[];
this
.
navigateActions
[
Position
.
LEFT
]
=
instantiationService
.
createInstance
(
FocusFirstGroupAction
,
FocusFirstGroupAction
.
ID
,
FocusFirstGroupAction
.
LABEL
);
this
.
navigateActions
[
Position
.
CENTER
]
=
instantiationService
.
createInstance
(
FocusSecondGroupAction
,
FocusSecondGroupAction
.
ID
,
FocusSecondGroupAction
.
LABEL
);
this
.
navigateActions
[
Position
.
RIGHT
]
=
instantiationService
.
createInstance
(
FocusThirdGroupAction
,
FocusThirdGroupAction
.
ID
,
FocusThirdGroupAction
.
LABEL
);
this
.
navigateActions
[
Position
.
ONE
]
=
instantiationService
.
createInstance
(
FocusFirstGroupAction
,
FocusFirstGroupAction
.
ID
,
FocusFirstGroupAction
.
LABEL
);
this
.
navigateActions
[
Position
.
TWO
]
=
instantiationService
.
createInstance
(
FocusSecondGroupAction
,
FocusSecondGroupAction
.
ID
,
FocusSecondGroupAction
.
LABEL
);
this
.
navigateActions
[
Position
.
THREE
]
=
instantiationService
.
createInstance
(
FocusThirdGroupAction
,
FocusThirdGroupAction
.
ID
,
FocusThirdGroupAction
.
LABEL
);
}
public
run
(
event
?:
any
):
TPromise
<
any
>
{
...
...
@@ -388,11 +388,11 @@ export class FocusNextGroup extends Action {
let
nextPosition
:
Position
;
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
if
(
!
activeEditor
)
{
nextPosition
=
Position
.
LEFT
;
}
else
if
(
activeEditor
.
position
===
Position
.
LEFT
)
{
nextPosition
=
Position
.
CENTER
;
}
else
if
(
activeEditor
.
position
===
Position
.
CENTER
)
{
nextPosition
=
Position
.
RIGHT
;
nextPosition
=
Position
.
ONE
;
}
else
if
(
activeEditor
.
position
===
Position
.
ONE
)
{
nextPosition
=
Position
.
TWO
;
}
else
if
(
activeEditor
.
position
===
Position
.
TWO
)
{
nextPosition
=
Position
.
THREE
;
}
// Run the action for the target next position
...
...
@@ -419,7 +419,7 @@ export class OpenToSideAction extends Action {
private
updateEnablement
():
void
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
RIGHT
);
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
THREE
);
}
public
run
(
context
:
any
):
TPromise
<
any
>
{
...
...
@@ -676,13 +676,13 @@ export class MoveGroupLeftAction extends Action {
let
position
=
context
?
this
.
editorGroupService
.
getStacksModel
().
positionOfGroup
(
context
.
group
)
:
null
;
if
(
typeof
position
!==
'
number
'
)
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
if
(
activeEditor
&&
(
activeEditor
.
position
===
Position
.
CENTER
||
activeEditor
.
position
===
Position
.
RIGHT
))
{
if
(
activeEditor
&&
(
activeEditor
.
position
===
Position
.
TWO
||
activeEditor
.
position
===
Position
.
THREE
))
{
position
=
activeEditor
.
position
;
}
}
if
(
typeof
position
===
'
number
'
)
{
const
newPosition
=
(
position
===
Position
.
CENTER
)
?
Position
.
LEFT
:
Position
.
CENTER
;
const
newPosition
=
(
position
===
Position
.
TWO
)
?
Position
.
ONE
:
Position
.
TWO
;
// Move group
this
.
editorGroupService
.
moveGroup
(
position
,
newPosition
);
...
...
@@ -712,13 +712,13 @@ export class MoveGroupRightAction extends Action {
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
const
editors
=
this
.
editorService
.
getVisibleEditors
();
if
((
editors
.
length
===
2
&&
activeEditor
.
position
===
Position
.
LEFT
)
||
(
editors
.
length
===
3
&&
activeEditor
.
position
!==
Position
.
RIGHT
))
{
if
((
editors
.
length
===
2
&&
activeEditor
.
position
===
Position
.
ONE
)
||
(
editors
.
length
===
3
&&
activeEditor
.
position
!==
Position
.
THREE
))
{
position
=
activeEditor
.
position
;
}
}
if
(
typeof
position
===
'
number
'
)
{
const
newPosition
=
(
position
===
Position
.
LEFT
)
?
Position
.
CENTER
:
Position
.
RIGHT
;
const
newPosition
=
(
position
===
Position
.
ONE
)
?
Position
.
TWO
:
Position
.
THREE
;
// Move group
this
.
editorGroupService
.
moveGroup
(
position
,
newPosition
);
...
...
@@ -1014,9 +1014,9 @@ export class ShowEditorsInGroupAction extends Action {
}
switch
(
stacks
.
positionOfGroup
(
context
.
group
))
{
case
Position
.
CENTER
:
case
Position
.
TWO
:
return
this
.
quickOpenService
.
show
((
groupCount
===
2
)
?
NAVIGATE_IN_RIGHT_GROUP_PREFIX
:
NAVIGATE_IN_CENTER_GROUP_PREFIX
);
case
Position
.
RIGHT
:
case
Position
.
THREE
:
return
this
.
quickOpenService
.
show
(
NAVIGATE_IN_RIGHT_GROUP_PREFIX
);
}
...
...
@@ -1057,9 +1057,9 @@ export class BaseQuickOpenEditorInGroupAction extends Action {
const
count
=
stacks
.
groups
.
length
;
let
prefix
=
NAVIGATE_IN_LEFT_GROUP_PREFIX
;
if
(
activePosition
===
Position
.
CENTER
&&
count
===
3
)
{
if
(
activePosition
===
Position
.
TWO
&&
count
===
3
)
{
prefix
=
NAVIGATE_IN_CENTER_GROUP_PREFIX
;
}
else
if
(
activePosition
===
Position
.
RIGHT
||
(
activePosition
===
Position
.
CENTER
&&
count
===
2
))
{
}
else
if
(
activePosition
===
Position
.
THREE
||
(
activePosition
===
Position
.
TWO
&&
count
===
2
))
{
prefix
=
NAVIGATE_IN_RIGHT_GROUP_PREFIX
;
}
...
...
@@ -1238,7 +1238,7 @@ export class MoveEditorToLeftGroupAction extends Action {
public
run
():
TPromise
<
any
>
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
if
(
activeEditor
&&
activeEditor
.
position
!==
Position
.
LEFT
)
{
if
(
activeEditor
&&
activeEditor
.
position
!==
Position
.
ONE
)
{
this
.
editorGroupService
.
moveEditor
(
activeEditor
.
input
,
activeEditor
.
position
,
activeEditor
.
position
-
1
);
}
...
...
@@ -1262,7 +1262,7 @@ export class MoveEditorToRightGroupAction extends Action {
public
run
():
TPromise
<
any
>
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
if
(
activeEditor
&&
activeEditor
.
position
!==
Position
.
RIGHT
)
{
if
(
activeEditor
&&
activeEditor
.
position
!==
Position
.
THREE
)
{
this
.
editorGroupService
.
moveEditor
(
activeEditor
.
input
,
activeEditor
.
position
,
activeEditor
.
position
+
1
);
}
...
...
src/vs/workbench/browser/parts/editor/editorCommands.ts
浏览文件 @
7352ad52
...
...
@@ -127,13 +127,13 @@ function moveActiveEditorToGroup(args: ActiveEditorMoveArguments, activeEditor:
newPosition
=
newPosition
+
1
;
break
;
case
ActiveEditorMovePositioning
.
FIRST
:
newPosition
=
Position
.
LEFT
;
newPosition
=
Position
.
ONE
;
break
;
case
ActiveEditorMovePositioning
.
LAST
:
newPosition
=
Position
.
RIGHT
;
newPosition
=
Position
.
THREE
;
break
;
case
ActiveEditorMovePositioning
.
CENTER
:
newPosition
=
Position
.
CENTER
;
newPosition
=
Position
.
TWO
;
break
;
case
ActiveEditorMovePositioning
.
POSITION
:
newPosition
=
args
.
value
-
1
;
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
7352ad52
...
...
@@ -204,7 +204,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
}
// Opened to the side
if
(
position
!==
Position
.
LEFT
)
{
if
(
position
!==
Position
.
ONE
)
{
this
.
telemetryService
.
publicLog
(
'
workbenchSideEditorOpened
'
,
{
position
:
position
});
}
...
...
@@ -915,13 +915,13 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
}
private
doOpenEditors
(
editors
:
{
input
:
EditorInput
,
position
:
Position
,
options
?:
EditorOptions
}[],
activePosition
?:
number
,
ratio
?:
number
[]):
TPromise
<
BaseEditor
[]
>
{
const
leftEditors
=
editors
.
filter
(
e
=>
e
.
position
===
Position
.
LEFT
);
const
centerEditors
=
editors
.
filter
(
e
=>
e
.
position
===
Position
.
CENTER
);
const
rightEditors
=
editors
.
filter
(
e
=>
e
.
position
===
Position
.
RIGHT
);
const
leftEditors
=
editors
.
filter
(
e
=>
e
.
position
===
Position
.
ONE
);
const
centerEditors
=
editors
.
filter
(
e
=>
e
.
position
===
Position
.
TWO
);
const
rightEditors
=
editors
.
filter
(
e
=>
e
.
position
===
Position
.
THREE
);
const
leftGroup
=
this
.
stacks
.
groupAt
(
Position
.
LEFT
);
const
centerGroup
=
this
.
stacks
.
groupAt
(
Position
.
CENTER
);
const
rightGroup
=
this
.
stacks
.
groupAt
(
Position
.
RIGHT
);
const
leftGroup
=
this
.
stacks
.
groupAt
(
Position
.
ONE
);
const
centerGroup
=
this
.
stacks
.
groupAt
(
Position
.
TWO
);
const
rightGroup
=
this
.
stacks
.
groupAt
(
Position
.
THREE
);
// Compute the imaginary count if we const all editors open as the way requested
const
leftCount
=
leftEditors
.
length
+
(
leftGroup
?
leftGroup
.
count
:
0
);
...
...
@@ -938,7 +938,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
// Validate active input
if
(
typeof
activePosition
!==
'
number
'
)
{
activePosition
=
Position
.
LEFT
;
activePosition
=
Position
.
ONE
;
}
// Validate ratios
...
...
@@ -1173,7 +1173,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
const
visibleEditors
=
this
.
getVisibleEditors
();
const
activeEditor
=
this
.
getActiveEditor
();
if
(
visibleEditors
.
length
===
0
||
!
activeEditor
)
{
return
Position
.
LEFT
;
// can only be LEFT
return
Position
.
ONE
;
// can only be LEFT
}
// Respect option to reveal an editor if it is already visible
...
...
@@ -1193,17 +1193,17 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
if
(
types
.
isUndefinedOrNull
(
arg1
)
||
arg1
===
false
)
{
const
lastActivePosition
=
this
.
sideBySideControl
.
getActivePosition
();
return
lastActivePosition
||
Position
.
LEFT
;
return
lastActivePosition
||
Position
.
ONE
;
}
// Position is sideBySide: Find position relative to active editor
if
(
arg1
===
true
)
{
switch
(
activeEditor
.
position
)
{
case
Position
.
LEFT
:
return
Position
.
CENTER
;
case
Position
.
CENTER
:
return
Position
.
RIGHT
;
case
Position
.
RIGHT
:
case
Position
.
ONE
:
return
Position
.
TWO
;
case
Position
.
TWO
:
return
Position
.
THREE
;
case
Position
.
THREE
:
return
null
;
// Cannot open to the side of the right most editor
}
...
...
@@ -1211,8 +1211,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
}
// Position is provided, validate it
if
(
arg1
===
Position
.
RIGHT
&&
visibleEditors
.
length
===
1
)
{
return
Position
.
CENTER
;
if
(
arg1
===
Position
.
THREE
&&
visibleEditors
.
length
===
1
)
{
return
Position
.
TWO
;
}
return
arg1
;
...
...
@@ -1260,15 +1260,15 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
if
(
types
.
isUndefinedOrNull
(
arg2
))
{
const
rochade
=
<
Rochade
>
arg1
;
switch
(
rochade
)
{
case
Rochade
.
CENTER_TO_LEFT
:
this
.
rochade
(
Position
.
CENTER
,
Position
.
LEFT
);
case
Rochade
.
TWO_TO_ONE
:
this
.
rochade
(
Position
.
TWO
,
Position
.
ONE
);
break
;
case
Rochade
.
RIGHT_TO_CENTER
:
this
.
rochade
(
Position
.
RIGHT
,
Position
.
CENTER
);
case
Rochade
.
THREE_TO_TWO
:
this
.
rochade
(
Position
.
THREE
,
Position
.
TWO
);
break
;
case
Rochade
.
CENTER_AND_RIGHT_TO_LEFT
:
this
.
rochade
(
Position
.
CENTER
,
Position
.
LEFT
);
this
.
rochade
(
Position
.
RIGHT
,
Position
.
CENTER
);
case
Rochade
.
TWO_AND_THREE_TO_ONE
:
this
.
rochade
(
Position
.
TWO
,
Position
.
ONE
);
this
.
rochade
(
Position
.
THREE
,
Position
.
TWO
);
}
}
else
{
const
from
=
<
Position
>
arg1
;
...
...
@@ -1329,20 +1329,20 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
// LEFT | CENTER | RIGHT
if
(
groups
.
length
>
2
)
{
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
LEFT
),
EditorPart
.
GROUP_LEFT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
CENTER
),
EditorPart
.
GROUP_CENTER_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
RIGHT
),
EditorPart
.
GROUP_RIGHT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
ONE
),
EditorPart
.
GROUP_LEFT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
TWO
),
EditorPart
.
GROUP_CENTER_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
THREE
),
EditorPart
.
GROUP_RIGHT_LABEL
);
}
// LEFT | RIGHT
else
if
(
groups
.
length
>
1
)
{
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
LEFT
),
EditorPart
.
GROUP_LEFT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
CENTER
),
EditorPart
.
GROUP_RIGHT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
ONE
),
EditorPart
.
GROUP_LEFT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
TWO
),
EditorPart
.
GROUP_RIGHT_LABEL
);
}
// LEFT
else
{
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
LEFT
),
EditorPart
.
GROUP_LEFT_LABEL
);
this
.
stacks
.
renameGroup
(
this
.
stacks
.
groupAt
(
Position
.
ONE
),
EditorPart
.
GROUP_LEFT_LABEL
);
}
}
}
...
...
src/vs/workbench/browser/parts/editor/editorPicker.ts
浏览文件 @
7352ad52
...
...
@@ -217,7 +217,7 @@ export abstract class EditorGroupPicker extends BaseEditorPicker {
export
class
LeftEditorGroupPicker
extends
EditorGroupPicker
{
protected
getPosition
():
Position
{
return
Position
.
LEFT
;
return
Position
.
ONE
;
}
}
...
...
@@ -226,7 +226,7 @@ export class CenterEditorGroupPicker extends EditorGroupPicker {
protected
getPosition
():
Position
{
const
stacks
=
this
.
editorGroupService
.
getStacksModel
();
return
stacks
.
groups
.
length
>
2
?
Position
.
CENTER
:
-
1
;
// with 2 groups open, the center one is not available
return
stacks
.
groups
.
length
>
2
?
Position
.
TWO
:
-
1
;
// with 2 groups open, the center one is not available
}
}
...
...
@@ -235,7 +235,7 @@ export class RightEditorGroupPicker extends EditorGroupPicker {
protected
getPosition
():
Position
{
const
stacks
=
this
.
editorGroupService
.
getStacksModel
();
return
stacks
.
groups
.
length
>
2
?
Position
.
RIGHT
:
Position
.
CENTER
;
return
stacks
.
groups
.
length
>
2
?
Position
.
THREE
:
Position
.
TWO
;
}
}
...
...
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
浏览文件 @
7352ad52
此差异已折叠。
点击以展开。
src/vs/workbench/electron-browser/integration.ts
浏览文件 @
7352ad52
...
...
@@ -257,7 +257,7 @@ export class ElectronIntegration {
return
this
.
editorService
.
openEditors
(
resources
.
map
((
r
,
index
)
=>
{
return
{
input
:
r
,
position
:
activeEditor
?
activeEditor
.
position
:
Position
.
LEFT
position
:
activeEditor
?
activeEditor
.
position
:
Position
.
ONE
};
}));
});
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
7352ad52
...
...
@@ -20,6 +20,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
isWindows
,
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
IOptions
}
from
'
vs/workbench/common/options
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
TextEditorOptions
,
EditorInput
,
EditorOptions
}
from
'
vs/workbench/common/editor
'
;
...
...
@@ -248,7 +249,7 @@ export class Workbench implements IPartService {
return
{
input
:
inputWithOptions
.
input
,
options
:
inputWithOptions
.
options
,
position
:
Position
.
LEFT
position
:
EditorPosition
.
ONE
};
});
...
...
src/vs/workbench/parts/extensions/electron-browser/dependenciesViewer.ts
浏览文件 @
7352ad52
...
...
@@ -217,7 +217,7 @@ class OpenExtensionToSideAction extends Action {
private
updateEnablement
():
void
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
RIGHT
);
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
THREE
);
}
run
(
context
:
{
extension
:
IExtension
}):
TPromise
<
any
>
{
...
...
src/vs/workbench/parts/files/browser/fileActions.ts
浏览文件 @
7352ad52
...
...
@@ -1175,7 +1175,7 @@ export class OpenToSideAction extends Action {
private
updateEnablement
():
void
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
RIGHT
);
this
.
enabled
=
(
!
activeEditor
||
activeEditor
.
position
!==
Position
.
THREE
);
}
public
run
():
TPromise
<
any
>
{
...
...
src/vs/workbench/parts/files/electron-browser/dirtyFilesTracker.ts
浏览文件 @
7352ad52
...
...
@@ -104,7 +104,7 @@ export class DirtyFilesTracker implements IWorkbenchContribution {
this
.
pendingDirtyResources
=
[];
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
const
activePosition
=
activeEditor
?
activeEditor
.
position
:
Position
.
LEFT
;
const
activePosition
=
activeEditor
?
activeEditor
.
position
:
Position
.
ONE
;
// Open
this
.
editorService
.
openEditors
(
dirtyNotOpenedResources
.
map
(
resource
=>
{
...
...
src/vs/workbench/test/browser/services.test.ts
浏览文件 @
7352ad52
...
...
@@ -290,7 +290,7 @@ suite('Workbench UI Services', () => {
assert
(
service
.
getVisibleEditors
()[
0
]
===
editor
);
});
service
.
openEditor
(
activeInput
,
null
,
Position
.
LEFT
).
then
((
editor
)
=>
{
service
.
openEditor
(
activeInput
,
null
,
Position
.
ONE
).
then
((
editor
)
=>
{
assert
.
strictEqual
(
openedEditorInput
,
activeInput
);
assert
.
strictEqual
(
openedEditorOptions
,
null
);
assert
.
strictEqual
(
editor
,
activeEditor
);
...
...
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
浏览文件 @
7352ad52
...
...
@@ -296,9 +296,9 @@ suite('Editor Stacks Model', () => {
const
group2
=
model
.
openGroup
(
'
second
'
);
const
group3
=
model
.
openGroup
(
'
third
'
);
assert
.
equal
(
Position
.
LEFT
,
model
.
positionOfGroup
(
group1
));
assert
.
equal
(
Position
.
CENTER
,
model
.
positionOfGroup
(
group2
));
assert
.
equal
(
Position
.
RIGHT
,
model
.
positionOfGroup
(
group3
));
assert
.
equal
(
Position
.
ONE
,
model
.
positionOfGroup
(
group1
));
assert
.
equal
(
Position
.
TWO
,
model
.
positionOfGroup
(
group2
));
assert
.
equal
(
Position
.
THREE
,
model
.
positionOfGroup
(
group3
));
});
test
(
'
Groups - Rename Group
'
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录