Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f3fa86d0
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,发现更多精彩内容 >>
提交
f3fa86d0
编写于
6月 07, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - better restore empty workspaces
上级
93ea9d1c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
8 deletion
+13
-8
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+4
-0
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+1
-1
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+8
-7
未找到文件。
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
f3fa86d0
...
...
@@ -1031,6 +1031,10 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return
this
.
doOpenEditors
(
editors
,
activePosition
,
ratio
);
}
public
hasEditorsToRestore
():
boolean
{
return
this
.
stacks
.
groups
.
some
(
g
=>
g
.
count
>
0
);
}
public
restoreEditors
():
TPromise
<
BaseEditor
[]
>
{
const
editors
=
this
.
stacks
.
groups
.
map
((
group
,
index
)
=>
{
return
{
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
f3fa86d0
...
...
@@ -692,7 +692,7 @@ export abstract class BaseOpenRecentAction extends Action {
const
hasWorkspace
=
this
.
contextService
.
hasWorkspace
();
this
.
quickOpenService
.
pick
(
folderPicks
.
concat
(...
filePicks
),
{
autoFocus
:
{
autoFocusFirstEntry
:
!
hasWorkspace
&&
!
this
.
isQuickNavigate
(),
autoFocusSecondEntry
:
hasWorkspace
||
this
.
isQuickNavigate
()
},
autoFocus
:
{
autoFocusFirstEntry
:
!
hasWorkspace
,
autoFocusSecondEntry
:
hasWorkspace
},
placeHolder
:
isMacintosh
?
nls
.
localize
(
'
openRecentPlaceHolderMac
'
,
"
Select a path (hold Cmd-key to open in new window)
"
)
:
nls
.
localize
(
'
openRecentPlaceHolder
'
,
"
Select a path to open (hold Ctrl-key to open in new window)
"
),
matchOnDescription
:
true
,
quickNavigateConfiguration
:
this
.
isQuickNavigate
()
?
{
keybindings
:
this
.
keybindingService
.
lookupKeybindings
(
this
.
id
)
}
:
void
0
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
f3fa86d0
...
...
@@ -426,6 +426,10 @@ export class Workbench implements IPartService {
// Empty workbench: some first time users will not have an untiled file; returning users will always have one
else
if
(
!
this
.
contextService
.
hasWorkspace
()
&&
this
.
telemetryService
.
getExperiments
().
openUntitledFile
&&
!
this
.
configurationService
.
lookup
(
'
workbench.welcome.enabled
'
).
value
)
{
if
(
this
.
editorPart
.
hasEditorsToRestore
())
{
return
TPromise
.
as
([]);
// do not open any empty untitled file if we have editors to restore
}
return
this
.
backupFileService
.
hasBackups
().
then
(
hasBackups
=>
{
if
(
hasBackups
)
{
return
TPromise
.
as
([]);
// do not open any empty untitled file if we have backups to restore
...
...
@@ -562,16 +566,13 @@ export class Workbench implements IPartService {
private
initSettings
():
void
{
// Sidebar visibility
this
.
sideBarHidden
=
this
.
storageService
.
getBoolean
(
Workbench
.
sidebarHiddenSettingKey
,
StorageScope
.
WORKSPACE
,
false
);
if
(
!
this
.
contextService
.
hasWorkspace
())
{
this
.
sideBarHidden
=
true
;
// we hide sidebar in single-file-mode
}
this
.
sideBarHidden
=
this
.
storageService
.
getBoolean
(
Workbench
.
sidebarHiddenSettingKey
,
StorageScope
.
WORKSPACE
,
!
this
.
contextService
.
hasWorkspace
());
// Panel part visibility
const
panelRegistry
=
Registry
.
as
<
PanelRegistry
>
(
PanelExtensions
.
Panels
);
this
.
panelHidden
=
this
.
storageService
.
getBoolean
(
Workbench
.
panelHiddenSettingKey
,
StorageScope
.
WORKSPACE
,
true
);
if
(
!
this
.
contextService
.
hasWorkspace
()
||
!
panelRegistry
.
getDefaultPanelId
())
{
this
.
panelHidden
=
true
;
// we hide panel part i
n single-file-mode or i
f there is no default panel
this
.
panelHidden
=
this
.
storageService
.
getBoolean
(
Workbench
.
panelHiddenSettingKey
,
StorageScope
.
WORKSPACE
,
!
this
.
contextService
.
hasWorkspace
()
);
if
(
!
panelRegistry
.
getDefaultPanelId
())
{
this
.
panelHidden
=
true
;
// we hide panel part if there is no default panel
}
// Sidebar position
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录