Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
26e9fd40
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,发现更多精彩内容 >>
提交
26e9fd40
编写于
1月 04, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #65931
上级
bbcc0f61
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
10 deletion
+18
-10
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/workbench/common/editor/editorGroup.ts
src/vs/workbench/common/editor/editorGroup.ts
+17
-10
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
26e9fd40
...
...
@@ -541,6 +541,7 @@
"./vs/workbench/common/editor/binaryEditorModel.ts"
,
"./vs/workbench/common/editor/dataUriEditorInput.ts"
,
"./vs/workbench/common/editor/diffEditorModel.ts"
,
"./vs/workbench/common/editor/editorGroup.ts"
,
"./vs/workbench/common/extensionHostProtocol.ts"
,
"./vs/workbench/common/memento.ts"
,
"./vs/workbench/common/notifications.ts"
,
...
...
src/vs/workbench/common/editor/editorGroup.ts
浏览文件 @
26e9fd40
...
...
@@ -296,13 +296,13 @@ export class EditorGroup extends Disposable {
}));
}
private
replaceEditor
(
toReplace
:
EditorInput
,
replaceWi
d
th
:
EditorInput
,
replaceIndex
:
number
,
openNext
=
true
):
void
{
private
replaceEditor
(
toReplace
:
EditorInput
,
replaceWith
:
EditorInput
,
replaceIndex
:
number
,
openNext
=
true
):
void
{
const
event
=
this
.
doCloseEditor
(
toReplace
,
openNext
,
true
);
// optimization to prevent multiple setActive() in one call
// We want to first add the new editor into our model before emitting the close event because
// firing the close event can trigger a dispose on the same editor that is now being added.
// This can lead into opening a disposed editor which is not what we want.
this
.
splice
(
replaceIndex
,
false
,
replaceWi
d
th
);
this
.
splice
(
replaceIndex
,
false
,
replaceWith
);
if
(
event
)
{
this
.
_onDidEditorClose
.
fire
(
event
);
...
...
@@ -513,7 +513,7 @@ export class EditorGroup extends Disposable {
}
// Replace
else
{
else
if
(
del
&&
editor
)
{
this
.
mru
.
splice
(
indexInMRU
,
1
,
editor
);
// replace MRU at location
this
.
updateResourceMap
(
editor
,
false
/* add */
);
// add new to resource map
this
.
updateResourceMap
(
editorToDeleteOrReplace
,
true
/* delete */
);
// remove replaced from resource map
...
...
@@ -527,17 +527,24 @@ export class EditorGroup extends Disposable {
// It is possible to have the same resource opened twice (once as normal input and once as diff input)
// So we need to do ref counting on the resource to provide the correct picture
let
counter
=
this
.
mapResourceToEditorCount
.
get
(
resource
)
||
0
;
const
counter
=
this
.
mapResourceToEditorCount
.
get
(
resource
)
||
0
;
// Add
let
newCounter
:
number
;
if
(
remove
)
{
if
(
counter
>
1
)
{
newCounter
=
counter
-
1
;
}
}
else
{
if
(
!
remove
)
{
newCounter
=
counter
+
1
;
}
// Delete
else
{
newCounter
=
counter
-
1
;
}
if
(
newCounter
>
0
)
{
this
.
mapResourceToEditorCount
.
set
(
resource
,
newCounter
);
}
else
{
this
.
mapResourceToEditorCount
.
delete
(
resource
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录