Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
4f335d86
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,发现更多精彩内容 >>
提交
4f335d86
编写于
6月 09, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move supportsSplitEditor to editor input and let it return true by default
上级
2dbc938c
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
18 addition
and
40 deletion
+18
-40
src/vs/workbench/browser/parts/editor/baseEditor.ts
src/vs/workbench/browser/parts/editor/baseEditor.ts
+0
-8
src/vs/workbench/browser/parts/editor/editorActions.ts
src/vs/workbench/browser/parts/editor/editorActions.ts
+2
-3
src/vs/workbench/browser/parts/editor/iframeEditor.ts
src/vs/workbench/browser/parts/editor/iframeEditor.ts
+0
-4
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
+2
-5
src/vs/workbench/browser/parts/editor/stringEditor.ts
src/vs/workbench/browser/parts/editor/stringEditor.ts
+0
-4
src/vs/workbench/browser/parts/editor/titleControl.ts
src/vs/workbench/browser/parts/editor/titleControl.ts
+3
-4
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+7
-0
src/vs/workbench/common/editor/diffEditorInput.ts
src/vs/workbench/common/editor/diffEditorInput.ts
+4
-0
src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts
...workbench/parts/files/browser/editors/binaryFileEditor.ts
+0
-4
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
...s/workbench/parts/files/browser/editors/textFileEditor.ts
+0
-4
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
+0
-4
未找到文件。
src/vs/workbench/browser/parts/editor/baseEditor.ts
浏览文件 @
4f335d86
...
...
@@ -131,14 +131,6 @@ export abstract class BaseEditor extends Panel implements IEditor {
return
this
.
_position
;
}
/**
* Controls if the editor shows an action to split the input of the editor to the side. Subclasses should override
* if they are capable of showing the same editor input side by side.
*/
public
supportsSplitEditor
():
boolean
{
return
false
;
}
public
dispose
():
void
{
this
.
_input
=
null
;
this
.
_options
=
null
;
...
...
src/vs/workbench/browser/parts/editor/editorActions.ts
浏览文件 @
4f335d86
...
...
@@ -7,7 +7,6 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorInput
,
getUntitledOrFileResource
,
TextEditorOptions
,
EditorOptions
,
IEditorIdentifier
}
from
'
vs/workbench/common/editor
'
;
import
{
QuickOpenEntryGroup
}
from
'
vs/base/parts/quickopen/browser/quickOpenModel
'
;
import
{
EditorQuickOpenEntry
,
EditorQuickOpenEntryGroup
,
IEditorQuickOpenEntry
,
QuickOpenAction
}
from
'
vs/workbench/browser/quickopen
'
;
...
...
@@ -49,7 +48,7 @@ export class SplitEditorAction extends Action {
}
// Return if the editor to split does not support split editing
if
(
!
(
<
BaseEditor
>
editorToSpli
t
).
supportsSplitEditor
())
{
if
(
editorToSplit
.
input
instanceof
EditorInput
&&
!
(
<
EditorInput
>
editorToSplit
.
inpu
t
).
supportsSplitEditor
())
{
return
TPromise
.
as
(
true
);
}
...
...
@@ -215,7 +214,7 @@ export abstract class BaseFocusSideGroupAction extends Action {
}
// Require the reference editor to be visible and supporting split editor
if
(
referenceEditor
&&
(
<
BaseEditor
>
referenceEditor
).
supportsSplitEditor
())
{
if
(
referenceEditor
&&
(
<
EditorInput
>
referenceEditor
.
input
).
supportsSplitEditor
())
{
return
this
.
editorService
.
openEditor
(
referenceEditor
.
input
,
null
,
this
.
getTargetEditorSide
());
}
...
...
src/vs/workbench/browser/parts/editor/iframeEditor.ts
浏览文件 @
4f335d86
...
...
@@ -261,10 +261,6 @@ export class IFrameEditor extends BaseEditor {
setTimeout
(()
=>
this
.
reload
(
true
));
}
public
supportsSplitEditor
():
boolean
{
return
true
;
}
/**
* Reloads the contents of the iframe in this editor by reapplying the input.
*/
...
...
src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts
浏览文件 @
4f335d86
...
...
@@ -10,9 +10,8 @@ import {prepareActions} from 'vs/workbench/browser/actionBarRegistry';
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorGroup
,
EditorInput
}
from
'
vs/workbench/common/editor
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
...
@@ -153,8 +152,6 @@ export class NoTabsTitleControl extends TitleControl {
const
isPinned
=
group
.
isPinned
(
group
.
activeEditor
);
const
isActive
=
this
.
stacks
.
isActive
(
group
);
const
position
=
this
.
stacks
.
positionOfGroup
(
group
);
const
control
=
this
.
editorService
.
getVisibleEditors
()[
position
];
// Pinned state
if
(
isPinned
)
{
...
...
@@ -194,7 +191,7 @@ export class NoTabsTitleControl extends TitleControl {
// Update Editor Actions Toolbar
const
editorActions
=
this
.
getEditorActions
(
group
);
const
primaryEditorActions
=
prepareActions
(
editorActions
.
primary
);
if
(
isActive
&&
control
instanceof
BaseEditor
&&
control
.
supportsSplitEditor
())
{
if
(
isActive
&&
editor
instanceof
EditorInput
&&
editor
.
supportsSplitEditor
())
{
primaryEditorActions
.
push
(
this
.
splitEditorAction
);
}
primaryEditorActions
.
push
(
this
.
closeEditorAction
);
...
...
src/vs/workbench/browser/parts/editor/stringEditor.ts
浏览文件 @
4f335d86
...
...
@@ -162,10 +162,6 @@ export class StringEditor extends BaseTextEditor {
}
}
public
supportsSplitEditor
():
boolean
{
return
true
;
}
public
clearInput
():
void
{
// Keep editor view state in settings to restore when coming back
...
...
src/vs/workbench/browser/parts/editor/titleControl.ts
浏览文件 @
4f335d86
...
...
@@ -13,7 +13,7 @@ import errors = require('vs/base/common/errors');
import
{
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
BaseEditor
,
IEditorInputActionContext
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
IEditorStacksModel
,
IEditorGroup
}
from
'
vs/workbench/common/editor
'
;
import
{
IEditorStacksModel
,
IEditorGroup
,
EditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
EventType
as
BaseEventType
}
from
'
vs/base/common/events
'
;
import
{
IActionItem
,
ActionsOrientation
,
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ToolBar
}
from
'
vs/base/browser/ui/toolbar/toolbar
'
;
...
...
@@ -208,8 +208,7 @@ export abstract class TitleControl {
}
protected
getGroupActions
(
group
:
IEditorGroup
):
IToolbarActions
{
const
position
=
this
.
stacks
.
positionOfGroup
(
group
);
const
editor
=
this
.
editorService
.
getVisibleEditors
()[
position
];
const
editor
=
group
.
activeEditor
;
const
primary
:
IAction
[]
=
[];
const
isOverflowing
=
group
.
count
>
1
;
...
...
@@ -241,7 +240,7 @@ export abstract class TitleControl {
}
// Splitting
if
(
editor
&&
editor
instanceof
BaseEditor
&&
editor
.
supportsSplitEditor
())
{
if
(
editor
instanceof
EditorInput
&&
editor
.
supportsSplitEditor
())
{
primary
.
push
(
this
.
splitEditorAction
);
}
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
4f335d86
...
...
@@ -121,6 +121,13 @@ export abstract class EditorInput extends EventEmitter implements IEditorInput {
this
.
dispose
();
}
/**
* Subclasses can set this to false if it does not make sense to split the editor input.
*/
public
supportsSplitEditor
():
boolean
{
return
true
;
}
/**
* Returns true if this input is identical to the otherInput.
*/
...
...
src/vs/workbench/common/editor/diffEditorInput.ts
浏览文件 @
4f335d86
...
...
@@ -153,6 +153,10 @@ export class DiffEditorInput extends BaseDiffEditorInput {
});
}
public
supportsSplitEditor
():
boolean
{
return
false
;
}
public
matches
(
otherInput
:
any
):
boolean
{
if
(
super
.
matches
(
otherInput
)
===
true
)
{
return
true
;
...
...
src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts
浏览文件 @
4f335d86
...
...
@@ -27,8 +27,4 @@ export class BinaryFileEditor extends BaseBinaryResourceEditor {
public
getTitle
():
string
{
return
this
.
getInput
()
?
this
.
getInput
().
getName
()
:
nls
.
localize
(
'
binaryFileEditor
'
,
"
Binary File Viewer
"
);
}
public
supportsSplitEditor
():
boolean
{
return
true
;
// yes, we can!
}
}
\ No newline at end of file
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
浏览文件 @
4f335d86
...
...
@@ -272,10 +272,6 @@ export class TextFileEditor extends BaseTextEditor {
return
options
;
}
public
supportsSplitEditor
():
boolean
{
return
true
;
// yes, we can!
}
/**
* Saves the text editor view state under the given key.
*/
...
...
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
浏览文件 @
4f335d86
...
...
@@ -68,10 +68,6 @@ export class HtmlPreviewPart extends BaseEditor {
super
.
dispose
();
}
public
supportsSplitEditor
():
boolean
{
return
true
;
}
public
createEditor
(
parent
:
Builder
):
void
{
this
.
_container
=
document
.
createElement
(
'
div
'
);
this
.
_container
.
style
.
paddingLeft
=
'
20px
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录