Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
6ae33840
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
6ae33840
编写于
7月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
getEditor() return null instead of undefined
上级
afe2da7e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
10 deletion
+10
-10
src/vs/workbench/browser/parts/editor/editorCommands.ts
src/vs/workbench/browser/parts/editor/editorCommands.ts
+2
-2
src/vs/workbench/browser/parts/editor/editorGroupView.ts
src/vs/workbench/browser/parts/editor/editorGroupView.ts
+1
-1
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+1
-1
src/vs/workbench/common/editor/editorGroup.ts
src/vs/workbench/common/editor/editorGroup.ts
+5
-5
src/vs/workbench/services/editor/common/editorGroupsService.ts
...s/workbench/services/editor/common/editorGroupsService.ts
+1
-1
未找到文件。
src/vs/workbench/browser/parts/editor/editorCommands.ts
浏览文件 @
6ae33840
...
...
@@ -443,11 +443,11 @@ export function splitEditor(editorGroupService: IEditorGroupsService, direction:
const
newGroup
=
editorGroupService
.
addGroup
(
sourceGroup
,
direction
);
// Split editor (if it can be split)
let
editorToCopy
:
IEditorInput
|
null
;
let
editorToCopy
:
IEditorInput
|
undefined
;
if
(
context
&&
typeof
context
.
editorIndex
===
'
number
'
)
{
editorToCopy
=
sourceGroup
.
getEditor
(
context
.
editorIndex
);
}
else
{
editorToCopy
=
sourceGroup
.
activeEditor
;
editorToCopy
=
types
.
withNullAsUndefined
(
sourceGroup
.
activeEditor
)
;
}
if
(
editorToCopy
&&
(
editorToCopy
as
EditorInput
).
supportsSplitEditor
())
{
...
...
src/vs/workbench/browser/parts/editor/editorGroupView.ts
浏览文件 @
6ae33840
...
...
@@ -729,7 +729,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
return
this
.
editors
;
}
getEditor
(
index
:
number
):
EditorInput
|
null
{
getEditor
(
index
:
number
):
EditorInput
|
undefined
{
return
this
.
_group
.
getEditor
(
index
);
}
...
...
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
6ae33840
...
...
@@ -695,7 +695,7 @@ export class TabsTitleControl extends TitleControl {
private
updateDropFeedback
(
element
:
HTMLElement
,
isDND
:
boolean
,
index
?:
number
):
void
{
const
isTab
=
(
typeof
index
===
'
number
'
);
const
editor
=
typeof
index
===
'
number
'
?
this
.
group
.
getEditor
(
index
)
:
null
;
const
editor
=
typeof
index
===
'
number
'
?
this
.
group
.
getEditor
(
index
)
:
undefined
;
const
isActiveTab
=
isTab
&&
!!
editor
&&
this
.
group
.
isActive
(
editor
);
// Background
...
...
src/vs/workbench/common/editor/editorGroup.ts
浏览文件 @
6ae33840
...
...
@@ -138,16 +138,16 @@ export class EditorGroup extends Disposable {
return
mru
?
this
.
mru
.
slice
(
0
)
:
this
.
editors
.
slice
(
0
);
}
getEditor
(
index
:
number
):
EditorInput
|
null
;
getEditor
(
resource
:
URI
):
EditorInput
|
null
;
getEditor
(
arg1
:
number
|
URI
):
EditorInput
|
null
{
getEditor
(
index
:
number
):
EditorInput
|
undefined
;
getEditor
(
resource
:
URI
):
EditorInput
|
undefined
;
getEditor
(
arg1
:
number
|
URI
):
EditorInput
|
undefined
{
if
(
typeof
arg1
===
'
number
'
)
{
return
this
.
editors
[
arg1
];
}
const
resource
:
URI
=
arg1
;
if
(
!
this
.
contains
(
resource
))
{
return
null
;
// fast check for resource opened or not
return
undefined
;
// fast check for resource opened or not
}
for
(
const
editor
of
this
.
editors
)
{
...
...
@@ -157,7 +157,7 @@ export class EditorGroup extends Disposable {
}
}
return
null
;
return
undefined
;
}
get
activeEditor
():
EditorInput
|
null
{
...
...
src/vs/workbench/services/editor/common/editorGroupsService.ts
浏览文件 @
6ae33840
...
...
@@ -411,7 +411,7 @@ export interface IEditorGroup {
/**
* Returns the editor at a specific index of the group.
*/
getEditor
(
index
:
number
):
IEditorInput
|
null
;
getEditor
(
index
:
number
):
IEditorInput
|
undefined
;
/**
* Get all editors that are currently opened in the group optionally
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录