Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f1add038
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,发现更多精彩内容 >>
提交
f1add038
编写于
6月 01, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
try to get rid of editor input changing event
上级
02970ec5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
7 addition
and
24 deletion
+7
-24
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+2
-2
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+0
-8
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
.../workbench/browser/parts/quickopen/quickOpenController.ts
+2
-2
src/vs/workbench/common/events.ts
src/vs/workbench/common/events.ts
+0
-9
src/vs/workbench/parts/files/browser/views/explorerView.ts
src/vs/workbench/parts/files/browser/views/explorerView.ts
+2
-2
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
.../workbench/test/browser/parts/quickOpen/quickopen.test.ts
+1
-1
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
f1add038
...
...
@@ -121,7 +121,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
panelHeight
=
this
.
storageService
.
getInteger
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
StorageScope
.
GLOBAL
,
0
);
this
.
toUnbind
.
push
(
themeService
.
onDidThemeChange
(
_
=>
this
.
relayout
()));
this
.
toUnbind
.
push
(
eventService
.
addListener2
(
EventType
.
EDITOR_INPUT_CHANG
ING
,
()
=>
this
.
onEditorInputChanging
()));
this
.
toUnbind
.
push
(
eventService
.
addListener2
(
EventType
.
EDITOR_INPUT_CHANG
ED
,
()
=>
this
.
onEditorInputChanged
()));
this
.
registerSashListeners
();
}
...
...
@@ -243,7 +243,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
});
}
private
onEditorInputChang
ing
():
void
{
private
onEditorInputChang
ed
():
void
{
// Make sure that we layout properly in case we detect that the sidebar is large enought to cause
// multiple opened editors to go below minimal size. The fix is to trigger a layout for any editor
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
f1add038
...
...
@@ -363,14 +363,10 @@ export class EditorPart extends Part implements IEditorPart {
}
private
doSetInput
(
group
:
EditorGroup
,
editor
:
BaseEditor
,
input
:
EditorInput
,
options
:
EditorOptions
,
monitor
:
ProgressMonitor
):
TPromise
<
BaseEditor
>
{
let
position
=
this
.
stacks
.
positionOfGroup
(
group
);
// Emit Input-Changed Event as appropiate
const
previousInput
=
editor
.
getInput
();
const
inputChanged
=
(
!
previousInput
||
!
previousInput
.
matches
(
input
)
||
(
options
&&
options
.
forceOpen
));
if
(
inputChanged
)
{
this
.
emit
(
WorkbenchEventType
.
EDITOR_INPUT_CHANGING
,
new
EditorEvent
(
editor
,
input
,
options
,
position
));
}
// Call into Editor
let
timerEvent
=
timer
.
start
(
timer
.
Topic
.
WORKBENCH
,
strings
.
format
(
'
Set Editor Input: {0}
'
,
input
.
getName
()));
...
...
@@ -523,9 +519,6 @@ export class EditorPart extends Part implements IEditorPart {
// Update stacks model
this
.
modifyGroups
(()
=>
this
.
stacks
.
closeGroup
(
group
));
// Emit Input-Changing Event
this
.
emit
(
WorkbenchEventType
.
EDITOR_INPUT_CHANGING
,
new
EditorEvent
(
null
,
null
,
null
,
position
));
// Hide Editor
this
.
doHideEditor
(
position
,
true
);
...
...
@@ -812,7 +805,6 @@ export class EditorPart extends Part implements IEditorPart {
// Emit as editor input change event so that clients get aware of new active editor
let
activeEditor
=
this
.
sideBySideControl
.
getActiveEditor
();
if
(
activeEditor
)
{
this
.
emit
(
WorkbenchEventType
.
EDITOR_INPUT_CHANGING
,
new
EditorEvent
(
activeEditor
));
this
.
emit
(
WorkbenchEventType
.
EDITOR_INPUT_CHANGED
,
new
EditorEvent
(
activeEditor
));
}
...
...
src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
浏览文件 @
f1add038
...
...
@@ -124,7 +124,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
public
create
():
void
{
// Listen on Editor Input Changes to show in MRU List
this
.
toUnbind
.
push
(
this
.
eventService
.
addListener2
(
EventType
.
EDITOR_INPUT_CHANG
ING
,
(
e
:
EditorEvent
)
=>
this
.
onEditorInputChanging
(
e
)));
this
.
toUnbind
.
push
(
this
.
eventService
.
addListener2
(
EventType
.
EDITOR_INPUT_CHANG
ED
,
(
e
:
EditorEvent
)
=>
this
.
onEditorInputChanged
(
e
)));
this
.
toUnbind
.
push
(
this
.
eventService
.
addListener2
(
EventType
.
EDITOR_SET_INPUT_ERROR
,
(
e
:
EditorInputEvent
)
=>
this
.
onEditorInputSetError
(
e
)));
// Editor History Model
...
...
@@ -135,7 +135,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
}
}
private
onEditorInputChang
ing
(
e
:
EditorEvent
):
void
{
private
onEditorInputChang
ed
(
e
:
EditorEvent
):
void
{
if
(
e
.
editorInput
)
{
// If an active editor is set, but is different from the one from the event, return early
...
...
src/vs/workbench/common/events.ts
浏览文件 @
f1add038
...
...
@@ -32,15 +32,6 @@ export class EventType {
*/
static
EDITOR_INPUT_OPENING
=
'
editorInputOpening
'
;
/**
* Event type for when the editor input is about to change. This event is being sent before (!) the input is being set
* to the active editor. Use EDITOR_INPUT_CHANGED to react after the input has been set and displayed by the editor.
*
* Note: This event will also be emitted when multiple editors are open and the user sets focus from the active editor
* to another one. This allows to detect a focus change of the active editor.
*/
static
EDITOR_INPUT_CHANGING
=
'
editorInputChanging
'
;
/**
* Event type for when the editor input has been changed in the currently active editor. This event is being sent after
* the input has been set and displayed by the editor.
...
...
src/vs/workbench/parts/files/browser/views/explorerView.ts
浏览文件 @
f1add038
...
...
@@ -140,14 +140,14 @@ export class ExplorerView extends CollapsibleViewletView {
return
this
.
doRefresh
().
then
(()
=>
{
// When the explorer viewer is loaded, listen to changes to the editor input
this
.
toDispose
.
push
(
this
.
eventService
.
addListener2
(
WorkbenchEventType
.
EDITOR_INPUT_CHANG
ING
,
(
e
:
EditorEvent
)
=>
this
.
onEditorInputChanging
(
e
)));
this
.
toDispose
.
push
(
this
.
eventService
.
addListener2
(
WorkbenchEventType
.
EDITOR_INPUT_CHANG
ED
,
(
e
:
EditorEvent
)
=>
this
.
onEditorInputChanged
(
e
)));
// Also handle configuration updates
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
onConfigurationUpdated
(
e
.
config
,
true
)));
});
}
private
onEditorInputChang
ing
(
e
:
EditorEvent
):
void
{
private
onEditorInputChang
ed
(
e
:
EditorEvent
):
void
{
// During workbench startup, the editor area might restore more than one editor from a previous
// session. When this happens there might be editor input changing events for side editors that
...
...
src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts
浏览文件 @
f1add038
...
...
@@ -241,7 +241,7 @@ suite('Workbench QuickOpen', () => {
let
cinput1
=
<
EditorInput
>
inst
.
createInstance
(
fileInputCtor
,
toResource
(
'
Hello World
'
),
'
text/plain
'
,
null
);
let
event
=
new
EditorEvent
(
null
,
cinput1
,
null
,
Position
.
LEFT
);
eventService
.
emit
(
EventType
.
EDITOR_INPUT_CHANG
ING
,
event
);
eventService
.
emit
(
EventType
.
EDITOR_INPUT_CHANG
ED
,
event
);
assert
.
equal
(
1
,
controller
.
getEditorHistoryModel
().
getEntries
().
length
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录