Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
cf5a15d1
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf5a15d1
编写于
6月 15, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Edits made within the peek view do not create an open editor. (fixes #7621)
上级
57c833a8
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
32 addition
and
3 deletion
+32
-3
src/vs/platform/editor/common/editor.ts
src/vs/platform/editor/common/editor.ts
+6
-0
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+7
-1
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+14
-2
src/vs/workbench/parts/files/browser/fileTracker.ts
src/vs/workbench/parts/files/browser/fileTracker.ts
+5
-0
未找到文件。
src/vs/platform/editor/common/editor.ts
浏览文件 @
cf5a15d1
...
...
@@ -162,6 +162,12 @@ export interface IEditorOptionsBag {
* The index in the document stack where to insert the editor into when opening.
*/
index
?:
number
;
/**
* An active editor that is opened will show its contents directly. Set to true to open an editor
* in the background.
*/
inactive
?:
boolean
;
}
export
interface
ITextEditorOptions
extends
IEditorOptionsBag
{
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
cf5a15d1
...
...
@@ -235,7 +235,13 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
// stacks model gets updated if any of the UI updating fails with an error.
const
group
=
this
.
ensureGroup
(
position
,
!
options
||
!
options
.
preserveFocus
);
const
pinned
=
!
this
.
previewEditors
||
(
options
&&
(
options
.
pinned
||
typeof
options
.
index
===
'
number
'
))
||
input
.
isDirty
();
group
.
openEditor
(
input
,
{
active
:
true
,
pinned
,
index
:
options
&&
options
.
index
});
const
active
=
(
group
.
count
===
0
)
||
!
options
||
!
options
.
inactive
;
group
.
openEditor
(
input
,
{
active
,
pinned
,
index
:
options
&&
options
.
index
});
// Return early if the editor is to be open inactive and there are other editors in this group to show
if
(
!
active
)
{
return
TPromise
.
as
<
BaseEditor
>
(
null
);
}
// Progress Monitor & Ref Counting
this
.
editorOpenToken
[
position
]
++
;
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
cf5a15d1
...
...
@@ -336,13 +336,15 @@ export class EditorOptions implements IEditorOptions {
preserveFocus
?:
boolean
;
forceOpen
?:
boolean
;
pinned
?:
boolean
,
index
?:
number
index
?:
number
,
inactive
?:
boolean
}):
EditorOptions
{
let
options
=
new
EditorOptions
();
options
.
preserveFocus
=
settings
.
preserveFocus
;
options
.
forceOpen
=
settings
.
forceOpen
;
options
.
pinned
=
settings
.
pinned
;
options
.
index
=
settings
.
index
;
options
.
inactive
=
settings
.
inactive
;
return
options
;
}
...
...
@@ -380,6 +382,12 @@ export class EditorOptions implements IEditorOptions {
* The index in the document stack where to insert the editor into when opening.
*/
public
index
:
number
;
/**
* An active editor that is opened will show its contents directly. Set to true to open an editor
* in the background.
*/
public
inactive
:
boolean
;
}
/**
...
...
@@ -395,7 +403,7 @@ export class TextEditorOptions extends EditorOptions {
public
static
from
(
input
:
IResourceInput
):
TextEditorOptions
{
let
options
:
TextEditorOptions
=
null
;
if
(
input
&&
input
.
options
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
input
.
options
.
preserveFocus
||
input
.
options
.
pinned
||
typeof
input
.
options
.
index
===
'
number
'
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
input
.
options
.
preserveFocus
||
input
.
options
.
pinned
||
input
.
options
.
inactive
||
typeof
input
.
options
.
index
===
'
number
'
)
{
options
=
new
TextEditorOptions
();
}
...
...
@@ -416,6 +424,10 @@ export class TextEditorOptions extends EditorOptions {
options
.
pinned
=
true
;
}
if
(
input
.
options
.
inactive
)
{
options
.
inactive
=
true
;
}
if
(
typeof
input
.
options
.
index
===
'
number
'
)
{
options
.
index
=
input
.
options
.
index
;
}
...
...
src/vs/workbench/parts/files/browser/fileTracker.ts
浏览文件 @
cf5a15d1
...
...
@@ -85,6 +85,11 @@ export class FileTracker implements IWorkbenchContribution {
if
(
this
.
textFileService
.
getAutoSaveMode
()
!==
AutoSaveMode
.
AFTER_SHORT_DELAY
)
{
this
.
updateActivityBadge
();
// no indication needed when auto save is enabled for short delay
}
// If a file becomes dirty but is not opened, we open it in the background
if
(
!
this
.
stacks
.
isOpen
(
e
.
resource
))
{
this
.
editorService
.
openEditor
({
resource
:
e
.
resource
,
options
:
{
inactive
:
true
}
}).
done
(
null
,
errors
.
onUnexpectedError
);
}
}
private
onTextFileSaveError
(
e
:
TextFileChangeEvent
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录