Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
14bf0807
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,发现更多精彩内容 >>
提交
14bf0807
编写于
12月 02, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Keep Editors Open menu choice in the editor '...' menu should be a checked option (fix #111668)
上级
b2ef1188
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
5 deletion
+9
-5
src/vs/workbench/browser/parts/editor/editor.contribution.ts
src/vs/workbench/browser/parts/editor/editor.contribution.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorCommands.ts
src/vs/workbench/browser/parts/editor/editorCommands.ts
+8
-4
未找到文件。
src/vs/workbench/browser/parts/editor/editor.contribution.ts
浏览文件 @
14bf0807
...
...
@@ -464,7 +464,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: editorCommands.
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
editorCommands
.
SHOW_EDITORS_IN_GROUP
,
title
:
nls
.
localize
(
'
showOpenedEditors
'
,
"
Show Opened Editors
"
)
},
group
:
'
3_open
'
,
order
:
10
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
editorCommands
.
CLOSE_EDITORS_IN_GROUP_COMMAND_ID
,
title
:
nls
.
localize
(
'
closeAll
'
,
"
Close All
"
)
},
group
:
'
5_close
'
,
order
:
10
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
editorCommands
.
CLOSE_SAVED_EDITORS_COMMAND_ID
,
title
:
nls
.
localize
(
'
closeAllSaved
'
,
"
Close Saved
"
)
},
group
:
'
5_close
'
,
order
:
20
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
editorCommands
.
KEEP_EDITORS_COMMAND_ID
,
title
:
nls
.
localize
(
'
toggleKeepEditors
'
,
"
Keep Editors Open
"
)
},
when
:
ContextKeyExpr
.
has
(
'
config.workbench.editor.enablePreview
'
)
,
group
:
'
7_settings
'
,
order
:
10
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
EditorTitle
,
{
command
:
{
id
:
editorCommands
.
TOGGLE_KEEP_EDITORS_COMMAND_ID
,
title
:
nls
.
localize
(
'
toggleKeepEditors
'
,
"
Keep Editors Open
"
),
toggled
:
ContextKeyExpr
.
not
(
'
config.workbench.editor.enablePreview
'
)
}
,
group
:
'
7_settings
'
,
order
:
10
});
interface
IEditorToolItem
{
id
:
string
;
title
:
string
;
icon
?:
{
dark
?:
URI
;
light
?:
URI
;
}
|
ThemeIcon
;
}
...
...
src/vs/workbench/browser/parts/editor/editorCommands.ts
浏览文件 @
14bf0807
...
...
@@ -40,7 +40,7 @@ export const CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID = 'workbench.action.closeOt
export
const
MOVE_ACTIVE_EDITOR_COMMAND_ID
=
'
moveActiveEditor
'
;
export
const
LAYOUT_EDITOR_GROUPS_COMMAND_ID
=
'
layoutEditorGroups
'
;
export
const
KEEP_EDITOR_COMMAND_ID
=
'
workbench.action.keepEditor
'
;
export
const
KEEP_EDITORS_COMMAND_ID
=
'
workbench.action.k
eepEditors
'
;
export
const
TOGGLE_KEEP_EDITORS_COMMAND_ID
=
'
workbench.action.toggleK
eepEditors
'
;
export
const
SHOW_EDITORS_IN_GROUP
=
'
workbench.action.showEditorsInGroup
'
;
export
const
PIN_EDITOR_COMMAND_ID
=
'
workbench.action.pinEditor
'
;
...
...
@@ -899,19 +899,23 @@ function registerOtherEditorCommands(): void {
});
CommandsRegistry
.
registerCommand
({
id
:
KEEP_EDITORS_COMMAND_ID
,
id
:
TOGGLE_
KEEP_EDITORS_COMMAND_ID
,
handler
:
accessor
=>
{
const
configurationService
=
accessor
.
get
(
IConfigurationService
);
const
notificationService
=
accessor
.
get
(
INotificationService
);
const
openerService
=
accessor
.
get
(
IOpenerService
);
// Update setting
configurationService
.
updateValue
(
'
workbench.editor.enablePreview
'
,
false
);
const
currentSetting
=
configurationService
.
getValue
<
boolean
>
(
'
workbench.editor.enablePreview
'
);
const
newSetting
=
currentSetting
===
true
?
false
:
true
;
configurationService
.
updateValue
(
'
workbench.editor.enablePreview
'
,
newSetting
);
// Inform user
notificationService
.
prompt
(
Severity
.
Info
,
nls
.
localize
(
'
disablePreview
'
,
"
Preview editors have been disabled in settings.
"
),
newSetting
?
nls
.
localize
(
'
enablePreview
'
,
"
Preview editors have been enabled in settings.
"
)
:
nls
.
localize
(
'
disablePreview
'
,
"
Preview editors have been disabled in settings.
"
),
[{
label
:
nls
.
localize
(
'
learnMode
'
,
"
Learn More
"
),
run
:
()
=>
openerService
.
open
(
'
https://go.microsoft.com/fwlink/?linkid=2147473
'
)
}]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录