Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
26e86f66
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,发现更多精彩内容 >>
提交
26e86f66
编写于
6月 29, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Preview tab does not have a stable position (fixes #8245)
上级
798b41ab
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
26 addition
and
11 deletion
+26
-11
src/vs/workbench/common/editor/editorStacksModel.ts
src/vs/workbench/common/editor/editorStacksModel.ts
+2
-2
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
...s/workbench/parts/files/browser/editors/textFileEditor.ts
+0
-2
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
...vs/workbench/test/common/editor/editorStacksModel.test.ts
+24
-7
未找到文件。
src/vs/workbench/common/editor/editorStacksModel.ts
浏览文件 @
26e86f66
...
...
@@ -251,8 +251,8 @@ export class EditorGroup implements IEditorGroup {
// Replace existing preview with this editor if we have a preview
if
(
this
.
preview
)
{
const
indexOfPreview
=
this
.
indexOf
(
this
.
preview
);
if
(
targetIndex
>
=
indexOfPreview
)
{
targetIndex
--
;
if
(
targetIndex
>
indexOfPreview
)
{
targetIndex
--
;
// accomodate for the fact that the preview editor closes
}
this
.
closeEditor
(
this
.
preview
,
!
makeActive
);
// optimization to prevent multiple setActive() in one call
...
...
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
浏览文件 @
26e86f66
...
...
@@ -34,7 +34,6 @@ import {IMessageService, Severity, CancelAction} from 'vs/platform/message/commo
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IThemeService
}
from
'
vs/workbench/services/themes/common/themeService
'
;
import
{
IHistoryService
}
from
'
vs/workbench/services/history/common/history
'
;
const
LEGACY_EDITOR_VIEW_STATE_PREFERENCE_KEY
=
'
editorViewState
'
;
// TODO@Ben migration
const
TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY
=
'
textEditorViewState
'
;
...
...
@@ -56,7 +55,6 @@ export class TextFileEditor extends BaseTextEditor {
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IFileService
private
fileService
:
IFileService
,
@
IViewletService
private
viewletService
:
IViewletService
,
@
IHistoryService
private
historyService
:
IHistoryService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IWorkspaceContextService
contextService
:
IWorkspaceContextService
,
@
IStorageService
storageService
:
IStorageService
,
...
...
src/vs/workbench/test/common/editor/editorStacksModel.test.ts
浏览文件 @
26e86f66
...
...
@@ -29,7 +29,7 @@ function create(): EditorStacksModel {
services
.
set
(
IWorkspaceContextService
,
new
TestContextService
());
const
config
=
new
TestConfigurationService
();
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}
});
services
.
set
(
IConfigurationService
,
config
);
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -644,7 +644,7 @@ suite('Editor Stacks Model', () => {
const
config
=
new
TestConfigurationService
();
services
.
set
(
IConfigurationService
,
config
);
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
left
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
left
'
}
});
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -1177,7 +1177,7 @@ suite('Editor Stacks Model', () => {
const
lifecycle
=
new
TestLifecycleService
();
services
.
set
(
ILifecycleService
,
lifecycle
);
const
config
=
new
TestConfigurationService
();
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}
});
services
.
set
(
IConfigurationService
,
config
);
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -1221,7 +1221,7 @@ suite('Editor Stacks Model', () => {
const
lifecycle
=
new
TestLifecycleService
();
services
.
set
(
ILifecycleService
,
lifecycle
);
const
config
=
new
TestConfigurationService
();
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}
});
services
.
set
(
IConfigurationService
,
config
);
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -1303,7 +1303,7 @@ suite('Editor Stacks Model', () => {
const
lifecycle
=
new
TestLifecycleService
();
services
.
set
(
ILifecycleService
,
lifecycle
);
const
config
=
new
TestConfigurationService
();
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}
});
services
.
set
(
IConfigurationService
,
config
);
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -1353,7 +1353,7 @@ suite('Editor Stacks Model', () => {
const
lifecycle
=
new
TestLifecycleService
();
services
.
set
(
ILifecycleService
,
lifecycle
);
const
config
=
new
TestConfigurationService
();
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}
});
services
.
set
(
IConfigurationService
,
config
);
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -1395,7 +1395,7 @@ suite('Editor Stacks Model', () => {
const
lifecycle
=
new
TestLifecycleService
();
services
.
set
(
ILifecycleService
,
lifecycle
);
const
config
=
new
TestConfigurationService
();
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}});
config
.
setUserConfiguration
(
'
workbench
'
,
{
editor
:
{
openPositioning
:
'
right
'
}
});
services
.
set
(
IConfigurationService
,
config
);
let
inst
=
new
InstantiationService
(
services
);
...
...
@@ -1716,4 +1716,21 @@ suite('Editor Stacks Model', () => {
assert
.
ok
(
events
.
changed
[
5
].
structural
);
// close
assert
.
equal
(
events
.
changed
[
5
].
editor
,
input1
);
});
test
(
'
Preview tab does not have a stable position (https://github.com/Microsoft/vscode/issues/8245)
'
,
function
()
{
const
model
=
create
();
const
group1
=
model
.
openGroup
(
'
first
'
);
const
input1
=
input
();
const
input2
=
input
();
const
input3
=
input
();
group1
.
openEditor
(
input1
,
{
pinned
:
true
,
active
:
true
});
group1
.
openEditor
(
input2
,
{
active
:
true
});
group1
.
setActive
(
input1
);
group1
.
openEditor
(
input3
,
{
active
:
true
});
assert
.
equal
(
group1
.
indexOf
(
input3
),
1
);
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录