Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
168ebd1e
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,发现更多精彩内容 >>
未验证
提交
168ebd1e
编写于
11月 06, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #95599
上级
256066f9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
17 deletion
+54
-17
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
+44
-2
src/vs/workbench/contrib/scm/browser/media/dirtydiffDecorator.css
...orkbench/contrib/scm/browser/media/dirtydiffDecorator.css
+0
-15
src/vs/workbench/contrib/scm/browser/scm.contribution.ts
src/vs/workbench/contrib/scm/browser/scm.contribution.ts
+10
-0
未找到文件。
src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
浏览文件 @
168ebd1e
...
...
@@ -563,20 +563,57 @@ export class DirtyDiffController extends Disposable implements IEditorContributi
private
session
:
IDisposable
=
Disposable
.
None
;
private
mouseDownInfo
:
{
lineNumber
:
number
}
|
null
=
null
;
private
enabled
=
false
;
private
gutterActionDisposables
=
new
DisposableStore
();
private
stylesheet
:
HTMLStyleElement
;
constructor
(
private
editor
:
ICodeEditor
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
)
{
super
();
this
.
enabled
=
!
contextKeyService
.
getContextKeyValue
(
'
isInDiffEditor
'
);
this
.
stylesheet
=
createStyleSheet
();
this
.
_register
(
toDisposable
(()
=>
this
.
stylesheet
.
remove
()));
if
(
this
.
enabled
)
{
this
.
isDirtyDiffVisible
=
isDirtyDiffVisible
.
bindTo
(
contextKeyService
);
this
.
_register
(
editor
.
onMouseDown
(
e
=>
this
.
onEditorMouseDown
(
e
)));
this
.
_register
(
editor
.
onMouseUp
(
e
=>
this
.
onEditorMouseUp
(
e
)));
this
.
_register
(
editor
.
onDidChangeModel
(()
=>
this
.
close
()));
const
onDidChangeGutterAction
=
Event
.
filter
(
configurationService
.
onDidChangeConfiguration
,
e
=>
e
.
affectsConfiguration
(
'
scm.diffDecorationsGutterAction
'
));
this
.
_register
(
onDidChangeGutterAction
(
this
.
onDidChangeGutterAction
,
this
));
this
.
onDidChangeGutterAction
();
}
}
private
onDidChangeGutterAction
():
void
{
const
gutterAction
=
this
.
configurationService
.
getValue
<
'
diff
'
|
'
none
'
>
(
'
scm.diffDecorationsGutterAction
'
);
this
.
gutterActionDisposables
.
dispose
();
this
.
gutterActionDisposables
=
new
DisposableStore
();
if
(
gutterAction
===
'
diff
'
)
{
this
.
gutterActionDisposables
.
add
(
this
.
editor
.
onMouseDown
(
e
=>
this
.
onEditorMouseDown
(
e
)));
this
.
gutterActionDisposables
.
add
(
this
.
editor
.
onMouseUp
(
e
=>
this
.
onEditorMouseUp
(
e
)));
this
.
stylesheet
.
textContent
=
`
.monaco-editor .dirty-diff-glyph {
cursor: pointer;
}
.monaco-editor .margin-view-overlays .dirty-diff-glyph:hover::before {
width: 9px;
left: -6px;
}
.monaco-editor .margin-view-overlays .dirty-diff-deleted:hover::after {
bottom: 0;
border-top-width: 0;
border-bottom-width: 0;
}
`
;
}
else
{
this
.
stylesheet
.
textContent
=
``
;
}
}
...
...
@@ -798,6 +835,11 @@ export class DirtyDiffController extends Disposable implements IEditorContributi
return
model
.
changes
;
}
dispose
():
void
{
this
.
gutterActionDisposables
.
dispose
();
super
.
dispose
();
}
}
export
const
editorGutterModifiedBackground
=
registerColor
(
'
editorGutter.modifiedBackground
'
,
{
...
...
src/vs/workbench/contrib/scm/browser/media/dirtydiffDecorator.css
浏览文件 @
168ebd1e
...
...
@@ -5,7 +5,6 @@
.monaco-editor
.dirty-diff-glyph
{
margin-left
:
5px
;
cursor
:
pointer
;
z-index
:
5
;
}
...
...
@@ -39,20 +38,6 @@
transition
:
height
80ms
linear
;
}
.monaco-editor
.margin-view-overlays
.dirty-diff-glyph
:hover::before
{
position
:
absolute
;
content
:
''
;
height
:
100%
;
width
:
9px
;
left
:
-6px
;
}
.monaco-editor
.margin-view-overlays
.dirty-diff-deleted
:hover::after
{
bottom
:
0
;
border-top-width
:
0
;
border-bottom-width
:
0
;
}
/* Hide glyph decorations when inside the inline diff editor */
.monaco-editor.modified-in-monaco-diff-editor
.margin-view-overlays
>
div
>
.dirty-diff-glyph
{
display
:
none
;
...
...
src/vs/workbench/contrib/scm/browser/scm.contribution.ts
浏览文件 @
168ebd1e
...
...
@@ -138,6 +138,16 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).regis
description
:
localize
(
'
scm.diffDecorationsGutterVisibility
'
,
"
Controls the visibility of the Source Control diff decorator in the gutter.
"
),
default
:
'
always
'
},
'
scm.diffDecorationsGutterAction
'
:
{
type
:
'
string
'
,
enum
:
[
'
diff
'
,
'
none
'
],
enumDescriptions
:
[
localize
(
'
scm.diffDecorationsGutterAction.diff
'
,
"
Show the inline diff peek view on click.
"
),
localize
(
'
scm.diffDecorationsGutterAction.none
'
,
"
Do nothing.
"
)
],
description
:
localize
(
'
scm.diffDecorationsGutterAction
'
,
"
Controls the behavior of Source Control diff gutter decorations.
"
),
default
:
'
diff
'
},
'
scm.alwaysShowActions
'
:
{
type
:
'
boolean
'
,
description
:
localize
(
'
alwaysShowActions
'
,
"
Controls whether inline actions are always visible in the Source Control view.
"
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录