Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6153a487
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,发现更多精彩内容 >>
提交
6153a487
编写于
7月 15, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'revealIfOpened' flag should start at active editor (fixes #9265)
上级
be298bfd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
34 deletion
+19
-34
src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
...editor/contrib/goToDeclaration/browser/goToDeclaration.ts
+1
-1
src/vs/platform/editor/common/editor.ts
src/vs/platform/editor/common/editor.ts
+2
-3
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+2
-15
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+10
-11
src/vs/workbench/parts/files/browser/views/explorerView.ts
src/vs/workbench/parts/files/browser/views/explorerView.ts
+2
-2
src/vs/workbench/services/history/browser/history.ts
src/vs/workbench/services/history/browser/history.ts
+2
-2
未找到文件。
src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts
浏览文件 @
6153a487
...
...
@@ -136,7 +136,7 @@ export class DefinitionAction extends EditorAction {
resource
:
uri
,
options
:
{
selection
:
range
,
revealIf
Opened
:
!
sideBySide
revealIf
Visible
:
!
sideBySide
}
},
sideBySide
).
then
(
editor
=>
{
return
<
editorCommon
.
IEditor
>
editor
.
getControl
();
...
...
src/vs/platform/editor/common/editor.ts
浏览文件 @
6153a487
...
...
@@ -152,10 +152,9 @@ export interface IEditorOptions {
forceOpen
?:
boolean
;
/**
* Will reveal the editor if it is already opened in any editor group.
* This prevents duplicates of the same editor input showing up.
* Will reveal the editor if it is already opened and visible in any of the opened editor groups.
*/
revealIf
Opened
?:
boolean
;
revealIf
Visible
?:
boolean
;
/**
* An editor that is pinned remains in the editor stack even when another editor is being opened.
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
6153a487
...
...
@@ -1146,10 +1146,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
Position
.
LEFT
;
// can only be LEFT
}
// Respect option to reveal an editor if it is already opened
if
(
options
&&
options
.
revealIfOpened
)
{
// First check over active and visible editors from left to right
// Respect option to reveal an editor if it is already visible
if
(
options
&&
options
.
revealIfVisible
)
{
const
editorsToCheck
:
BaseEditor
[]
=
[];
if
(
activeEditor
)
{
editorsToCheck
.
push
(
activeEditor
);
}
visibleEditors
.
forEach
(
e
=>
{
if
(
e
!==
activeEditor
)
{
editorsToCheck
.
push
(
e
);
}});
...
...
@@ -1159,17 +1157,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
editorToCheck
.
position
;
}
}
// Then check over active and visible groups from left to right
const
groupsToCheck
:
EditorGroup
[]
=
[];
if
(
this
.
stacks
.
activeGroup
)
{
groupsToCheck
.
push
(
this
.
stacks
.
activeGroup
);
}
this
.
stacks
.
groups
.
forEach
(
g
=>
{
if
(
g
!==
this
.
stacks
.
activeGroup
)
{
groupsToCheck
.
push
(
g
);
}});
for
(
let
i
=
0
;
i
<
groupsToCheck
.
length
;
i
++
)
{
const
groupToCheck
=
groupsToCheck
[
i
];
if
(
groupToCheck
.
contains
(
input
))
{
return
this
.
stacks
.
positionOfGroup
(
groupToCheck
);
}
}
}
// Position is unknown: pick last active or LEFT
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
6153a487
...
...
@@ -430,7 +430,7 @@ export class EditorOptions implements IEditorOptions {
let
options
=
new
EditorOptions
();
options
.
preserveFocus
=
settings
.
preserveFocus
;
options
.
forceOpen
=
settings
.
forceOpen
;
options
.
revealIf
Opened
=
settings
.
revealIfOpened
;
options
.
revealIf
Visible
=
settings
.
revealIfVisible
;
options
.
pinned
=
settings
.
pinned
;
options
.
index
=
settings
.
index
;
options
.
inactive
=
settings
.
inactive
;
...
...
@@ -444,7 +444,7 @@ export class EditorOptions implements IEditorOptions {
public
mixin
(
other
:
EditorOptions
):
void
{
this
.
preserveFocus
=
other
.
preserveFocus
;
this
.
forceOpen
=
other
.
forceOpen
;
this
.
revealIf
Opened
=
other
.
revealIfOpened
;
this
.
revealIf
Visible
=
other
.
revealIfVisible
;
this
.
pinned
=
other
.
pinned
;
this
.
index
=
other
.
index
;
}
...
...
@@ -463,10 +463,9 @@ export class EditorOptions implements IEditorOptions {
public
forceOpen
:
boolean
;
/**
* Will reveal the editor if it is already opened in any editor group.
* This prevents duplicates of the same editor input showing up.
* Will reveal the editor if it is already opened and visible in any of the opened editor groups.
*/
public
revealIf
Opened
:
boolean
;
public
revealIf
Visible
:
boolean
;
/**
* An editor that is pinned remains in the editor stack even when another editor is being opened.
...
...
@@ -494,13 +493,13 @@ export class TextEditorOptions extends EditorOptions {
protected
startColumn
:
number
;
protected
endLineNumber
:
number
;
protected
endColumn
:
number
;
private
editorViewState
:
IEditorViewState
;
public
static
from
(
input
:
IResourceInput
):
TextEditorOptions
{
let
options
:
TextEditorOptions
=
null
;
if
(
input
&&
input
.
options
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
input
.
options
.
revealIf
Opened
||
input
.
options
.
preserveFocus
||
input
.
options
.
pinned
||
input
.
options
.
inactive
||
typeof
input
.
options
.
index
===
'
number
'
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
input
.
options
.
revealIf
Visible
||
input
.
options
.
preserveFocus
||
input
.
options
.
pinned
||
input
.
options
.
inactive
||
typeof
input
.
options
.
index
===
'
number
'
)
{
options
=
new
TextEditorOptions
();
}
...
...
@@ -513,8 +512,8 @@ export class TextEditorOptions extends EditorOptions {
options
.
forceOpen
=
true
;
}
if
(
input
.
options
.
revealIf
Opened
)
{
options
.
revealIf
Opened
=
true
;
if
(
input
.
options
.
revealIf
Visible
)
{
options
.
revealIf
Visible
=
true
;
}
if
(
input
.
options
.
preserveFocus
)
{
...
...
@@ -544,7 +543,7 @@ export class TextEditorOptions extends EditorOptions {
let
options
=
new
TextEditorOptions
();
options
.
preserveFocus
=
settings
.
preserveFocus
;
options
.
forceOpen
=
settings
.
forceOpen
;
options
.
revealIf
Opened
=
settings
.
revealIfOpened
;
options
.
revealIf
Visible
=
settings
.
revealIfVisible
;
options
.
pinned
=
settings
.
pinned
;
options
.
index
=
settings
.
index
;
...
...
@@ -654,7 +653,7 @@ export class TextDiffEditorOptions extends TextEditorOptions {
options
.
preserveFocus
=
settings
.
preserveFocus
;
options
.
forceOpen
=
settings
.
forceOpen
;
options
.
revealIf
Opened
=
settings
.
revealIfOpened
;
options
.
revealIf
Visible
=
settings
.
revealIfVisible
;
options
.
pinned
=
settings
.
pinned
;
options
.
index
=
settings
.
index
;
...
...
src/vs/workbench/parts/files/browser/views/explorerView.ts
浏览文件 @
6153a487
...
...
@@ -266,7 +266,7 @@ export class ExplorerView extends CollapsibleViewletView {
if
(
lastActiveFileResource
&&
root
&&
root
.
find
(
lastActiveFileResource
))
{
let
editorInput
=
this
.
instantiationService
.
createInstance
(
FileEditorInput
,
lastActiveFileResource
,
void
0
,
void
0
);
this
.
editorService
.
openEditor
(
editorInput
,
{
revealIf
Opened
:
true
}).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
editorService
.
openEditor
(
editorInput
,
{
revealIf
Visible
:
true
}).
done
(
null
,
errors
.
onUnexpectedError
);
return
refreshPromise
;
}
...
...
@@ -284,7 +284,7 @@ export class ExplorerView extends CollapsibleViewletView {
if
(
stat
&&
!
stat
.
isDirectory
)
{
let
editorInput
=
this
.
instantiationService
.
createInstance
(
FileEditorInput
,
stat
.
resource
,
stat
.
mime
,
void
0
);
this
.
editorService
.
openEditor
(
editorInput
,
{
preserveFocus
,
revealIf
Opened
:
true
}).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
editorService
.
openEditor
(
editorInput
,
{
preserveFocus
,
revealIf
Visible
:
true
}).
done
(
null
,
errors
.
onUnexpectedError
);
}
}
...
...
src/vs/workbench/services/history/browser/history.ts
浏览文件 @
6153a487
...
...
@@ -313,9 +313,9 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic
let
options
=
state
.
options
;
if
(
options
)
{
options
.
revealIf
Opened
=
true
;
options
.
revealIf
Visible
=
true
;
}
else
{
options
=
{
revealIf
Opened
:
true
};
options
=
{
revealIf
Visible
:
true
};
}
this
.
blockStackChanges
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录