Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8959f941
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,发现更多精彩内容 >>
提交
8959f941
编写于
7月 25, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Wrap up menu bar registration migration (#54510)
上级
d63937a4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
39 deletion
+55
-39
src/vs/workbench/browser/parts/menubar/menubarPart.ts
src/vs/workbench/browser/parts/menubar/menubarPart.ts
+0
-14
src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts
src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts
+0
-1
src/vs/workbench/parts/codeEditor/electron-browser/menubarRegistrations.ts
...parts/codeEditor/electron-browser/menubarRegistrations.ts
+0
-23
src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts
.../codeEditor/electron-browser/toggleMultiCursorModifier.ts
+55
-1
未找到文件。
src/vs/workbench/browser/parts/menubar/menubarPart.ts
浏览文件 @
8959f941
...
...
@@ -183,10 +183,6 @@ export class MenubarPart extends Part {
return
enableMenuBarMnemonics
;
}
private
get
currentMultiCursorSetting
():
string
{
return
this
.
configurationService
.
getValue
<
string
>
(
'
editor.multiCursorModifier
'
);
}
private
get
currentAutoSaveSetting
():
string
{
return
this
.
configurationService
.
getValue
<
string
>
(
'
files.autoSave
'
);
}
...
...
@@ -463,16 +459,6 @@ export class MenubarPart extends Part {
private
calculateActionLabel
(
action
:
IAction
|
IMenubarMenuItemAction
):
string
{
let
label
=
action
.
label
;
switch
(
action
.
id
)
{
case
'
workbench.action.toggleMultiCursorModifier
'
:
if
(
this
.
currentMultiCursorSetting
===
'
ctrlCmd
'
)
{
label
=
nls
.
localize
(
'
miMultiCursorAlt
'
,
"
Switch to Alt+Click for Multi-Cursor
"
);
}
else
{
label
=
isMacintosh
?
nls
.
localize
(
'
miMultiCursorCmd
'
,
"
Switch to Cmd+Click for Multi-Cursor
"
)
:
nls
.
localize
(
'
miMultiCursorCtrl
'
,
"
Switch to Ctrl+Click for Multi-Cursor
"
);
}
break
;
case
'
workbench.action.toggleSidebarPosition
'
:
if
(
this
.
currentSidebarPosition
!==
'
right
'
)
{
label
=
nls
.
localize
({
key
:
'
miMoveSidebarRight
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
&&Move Side Bar Right
"
);
...
...
src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts
浏览文件 @
8959f941
...
...
@@ -6,7 +6,6 @@
import
'
./electron-browser/accessibility
'
;
import
'
./electron-browser/inspectKeybindings
'
;
import
'
./electron-browser/largeFileOptimizations
'
;
import
'
./electron-browser/menubarRegistrations
'
;
import
'
./electron-browser/menuPreventer
'
;
import
'
./electron-browser/selectionClipboard
'
;
import
'
./electron-browser/textMate/inspectTMScopes
'
;
...
...
src/vs/workbench/parts/codeEditor/electron-browser/menubarRegistrations.ts
已删除
100644 → 0
浏览文件 @
d63937a4
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
selectionMenuRegistration
();
function
selectionMenuRegistration
()
{
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarSelectionMenu
,
{
group
:
'
3_multi
'
,
command
:
{
id
:
'
workbench.action.toggleMultiCursorModifier
'
,
title
:
nls
.
localize
(
'
miMultiCursorAlt
'
,
"
Switch to Alt+Click for Multi-Cursor
"
)
},
order
:
1
});
}
src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts
浏览文件 @
8959f941
...
...
@@ -6,11 +6,15 @@
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
SyncActionDescriptor
,
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
}
from
'
vs/workbench/common/actions
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
,
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
RawContextKey
,
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
export
class
ToggleMultiCursorModifierAction
extends
Action
{
...
...
@@ -35,5 +39,55 @@ export class ToggleMultiCursorModifierAction extends Action {
}
}
const
multiCursorModifier
=
new
RawContextKey
<
string
>
(
'
multiCursorModifier
'
,
'
altKey
'
);
class
MultiCursorModifierContextKeyController
implements
IWorkbenchContribution
{
private
readonly
_multiCursorModifier
:
IContextKey
<
string
>
;
constructor
(
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
this
.
_multiCursorModifier
=
multiCursorModifier
.
bindTo
(
contextKeyService
);
configurationService
.
onDidChangeConfiguration
((
e
)
=>
{
if
(
e
.
affectsConfiguration
(
'
editor.multiCursorModifier
'
))
{
this
.
_update
();
}
});
}
private
_update
():
void
{
const
editorConf
=
this
.
configurationService
.
getValue
<
{
multiCursorModifier
:
'
ctrlCmd
'
|
'
alt
'
}
>
(
'
editor
'
);
const
value
=
(
editorConf
.
multiCursorModifier
===
'
ctrlCmd
'
?
'
ctrlCmd
'
:
'
altKey
'
);
this
.
_multiCursorModifier
.
set
(
value
);
}
}
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
MultiCursorModifierContextKeyController
,
LifecyclePhase
.
Running
);
const
registry
=
Registry
.
as
<
IWorkbenchActionRegistry
>
(
Extensions
.
WorkbenchActions
);
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
ToggleMultiCursorModifierAction
,
ToggleMultiCursorModifierAction
.
ID
,
ToggleMultiCursorModifierAction
.
LABEL
),
'
Toggle Multi-Cursor Modifier
'
);
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarSelectionMenu
,
{
group
:
'
3_multi
'
,
command
:
{
id
:
ToggleMultiCursorModifierAction
.
ID
,
title
:
nls
.
localize
(
'
miMultiCursorAlt
'
,
"
Switch to Alt+Click for Multi-Cursor
"
)
},
when
:
multiCursorModifier
.
isEqualTo
(
'
ctrlCmd
'
),
order
:
1
});
MenuRegistry
.
appendMenuItem
(
MenuId
.
MenubarSelectionMenu
,
{
group
:
'
3_multi
'
,
command
:
{
id
:
ToggleMultiCursorModifierAction
.
ID
,
title
:
(
platform
.
isMacintosh
?
nls
.
localize
(
'
miMultiCursorCmd
'
,
"
Switch to Cmd+Click for Multi-Cursor
"
)
:
nls
.
localize
(
'
miMultiCursorCtrl
'
,
"
Switch to Ctrl+Click for Multi-Cursor
"
)
)
},
when
:
multiCursorModifier
.
isEqualTo
(
'
altKey
'
),
order
:
1
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录