Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
04c6d432
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,发现更多精彩内容 >>
提交
04c6d432
编写于
5月 24, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #26184
上级
2a5abbae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
2 deletion
+40
-2
extensions/git/src/commands.ts
extensions/git/src/commands.ts
+1
-1
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+23
-0
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+16
-1
未找到文件。
extensions/git/src/commands.ts
浏览文件 @
04c6d432
...
...
@@ -132,7 +132,7 @@ export class CommandCenter {
return
await
commands
.
executeCommand
<
void
>
(
'
vscode.open
'
,
right
);
}
return
await
commands
.
executeCommand
<
void
>
(
'
vscode.diff
'
,
left
,
right
,
title
);
return
await
commands
.
executeCommand
<
void
>
(
'
vscode.diff
'
,
left
,
right
,
title
,
{
preview
:
true
}
);
}
private
getLeftResource
(
resource
:
Resource
):
Uri
|
undefined
{
...
...
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
04c6d432
...
...
@@ -321,6 +321,7 @@ class MouseController<T> implements IDisposable {
this
.
disposables
=
[];
this
.
disposables
.
push
(
view
.
addListener
(
'
mousedown
'
,
e
=>
this
.
onMouseDown
(
e
)));
this
.
disposables
.
push
(
view
.
addListener
(
'
click
'
,
e
=>
this
.
onPointer
(
e
)));
this
.
disposables
.
push
(
view
.
addListener
(
'
dblclick
'
,
e
=>
this
.
onDoubleClick
(
e
)));
this
.
disposables
.
push
(
view
.
addListener
(
TouchEventType
.
Tap
,
e
=>
this
.
onPointer
(
e
)));
}
...
...
@@ -362,6 +363,19 @@ class MouseController<T> implements IDisposable {
this
.
list
.
open
(
focus
);
}
private
onDoubleClick
(
e
:
IListMouseEvent
<
T
>
):
void
{
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
isSelectionChangeEvent
(
e
))
{
return
;
}
const
focus
=
this
.
list
.
getFocus
();
this
.
list
.
setSelection
(
focus
);
this
.
list
.
pin
(
focus
);
}
private
changeSelection
(
e
:
IListMouseEvent
<
T
>
,
reference
:
number
|
undefined
):
void
{
const
focus
=
e
.
index
;
...
...
@@ -574,6 +588,11 @@ export class List<T> implements ISpliceable<T>, IDisposable {
return
mapEvent
(
this
.
_onOpen
.
event
,
indexes
=>
this
.
toListEvent
({
indexes
}));
}
private
_onPin
=
new
Emitter
<
number
[]
>
();
@
memoize
get
onPin
():
Event
<
IListEvent
<
T
>>
{
return
mapEvent
(
this
.
_onPin
.
event
,
indexes
=>
this
.
toListEvent
({
indexes
}));
}
private
_onDOMFocus
=
new
Emitter
<
void
>
();
get
onDOMFocus
():
Event
<
void
>
{
return
this
.
_onDOMFocus
.
event
;
}
...
...
@@ -813,6 +832,10 @@ export class List<T> implements ISpliceable<T>, IDisposable {
this
.
_onOpen
.
fire
(
indexes
);
}
pin
(
indexes
:
number
[]):
void
{
this
.
_onPin
.
fire
(
indexes
);
}
style
(
styles
:
IListStyles
):
void
{
const
content
:
string
[]
=
[];
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
04c6d432
...
...
@@ -25,6 +25,8 @@ import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm';
import
{
FileLabel
}
from
'
vs/workbench/browser/labels
'
;
import
{
CountBadge
}
from
'
vs/base/browser/ui/countBadge/countBadge
'
;
import
{
ISCMService
,
ISCMProvider
,
ISCMResourceGroup
,
ISCMResource
}
from
'
vs/workbench/services/scm/common/scm
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IContextViewService
,
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
...
...
@@ -243,7 +245,9 @@ export class SCMViewlet extends Viewlet {
@
IThemeService
protected
themeService
:
IThemeService
,
@
IMenuService
private
menuService
:
IMenuService
,
@
IModelService
private
modelService
:
IModelService
,
@
ICommandService
private
commandService
:
ICommandService
@
ICommandService
private
commandService
:
ICommandService
,
@
IEditorGroupService
private
groupService
:
IEditorGroupService
,
@
IWorkbenchEditorService
private
editorService
:
IWorkbenchEditorService
)
{
super
(
VIEWLET_ID
,
telemetryService
,
themeService
);
...
...
@@ -320,6 +324,11 @@ export class SCMViewlet extends Viewlet {
.
filter
(
e
=>
!!
e
&&
isSCMResource
(
e
))
.
on
(
this
.
open
,
this
,
this
.
disposables
);
chain
(
this
.
list
.
onPin
)
.
map
(
e
=>
e
.
elements
[
0
])
.
filter
(
e
=>
!!
e
&&
isSCMResource
(
e
))
.
on
(
this
.
pin
,
this
,
this
.
disposables
);
this
.
list
.
onContextMenu
(
this
.
onListContextMenu
,
this
,
this
.
disposables
);
this
.
disposables
.
push
(
this
.
list
);
...
...
@@ -406,6 +415,12 @@ export class SCMViewlet extends Viewlet {
.
done
(
undefined
,
onUnexpectedError
);
}
private
pin
():
void
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
const
activeEditorInput
=
this
.
editorService
.
getActiveEditorInput
();
this
.
groupService
.
pinEditor
(
activeEditor
.
position
,
activeEditorInput
);
}
getTitle
():
string
{
const
title
=
localize
(
'
source control
'
,
"
Source Control
"
);
const
providerLabel
=
this
.
scmService
.
activeProvider
&&
this
.
scmService
.
activeProvider
.
label
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录