Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
956de01b
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,发现更多精彩内容 >>
提交
956de01b
编写于
11月 14, 2016
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add add/del mark to marginDomNode in diff view zone
上级
e0ffb510
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
62 addition
and
7 deletion
+62
-7
src/vs/editor/browser/viewParts/viewZones/viewZones.ts
src/vs/editor/browser/viewParts/viewZones/viewZones.ts
+1
-1
src/vs/editor/browser/widget/diffEditorWidget.ts
src/vs/editor/browser/widget/diffEditorWidget.ts
+43
-6
src/vs/editor/browser/widget/media/addition.svg
src/vs/editor/browser/widget/media/addition.svg
+1
-0
src/vs/editor/browser/widget/media/deletion.svg
src/vs/editor/browser/widget/media/deletion.svg
+1
-0
src/vs/editor/browser/widget/media/diffEditor.css
src/vs/editor/browser/widget/media/diffEditor.css
+16
-0
未找到文件。
src/vs/editor/browser/viewParts/viewZones/viewZones.ts
浏览文件 @
956de01b
...
...
@@ -344,7 +344,7 @@ export class ViewZones extends ViewPart {
StyleMutator
.
setDisplay
(
zone
.
delegate
.
domNode
,
newDisplay
);
if
(
zone
.
delegate
.
marginDomNode
)
{
StyleMutator
.
setTop
(
zone
.
delegate
.
marginDomNode
,
newTop
);
StyleMutator
.
setTop
(
zone
.
delegate
.
marginDomNode
,
newTop
-
ctx
.
viewportTop
);
StyleMutator
.
setHeight
(
zone
.
delegate
.
marginDomNode
,
newHeight
);
StyleMutator
.
setDisplay
(
zone
.
delegate
.
marginDomNode
,
newDisplay
);
}
...
...
src/vs/editor/browser/widget/diffEditorWidget.ts
浏览文件 @
956de01b
...
...
@@ -847,8 +847,12 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif
clonedOptions
.
scrollbar
=
clonedOptions
.
scrollbar
||
{};
clonedOptions
.
scrollbar
.
vertical
=
'
visible
'
;
clonedOptions
.
folding
=
false
;
clonedOptions
.
glyphMargin
=
false
;
clonedOptions
.
codeLens
=
false
;
clonedOptions
.
fixedOverflowWidgets
=
true
;
if
(
typeof
options
.
fontSize
!==
'
undefined
'
)
{
clonedOptions
.
lineDecorationsWidth
=
0.8
*
options
.
fontSize
;
}
return
clonedOptions
;
}
...
...
@@ -1492,8 +1496,14 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd
let
lineChange
=
lineChanges
[
i
];
if
(
isChangeOrDelete
(
lineChange
))
{
result
.
decorations
.
push
(
createDecoration
(
lineChange
.
originalStartLineNumber
,
1
,
lineChange
.
originalEndLineNumber
,
Number
.
MAX_VALUE
,
'
line-delete
'
,
true
));
result
.
decorations
.
push
({
range
:
new
Range
(
lineChange
.
originalStartLineNumber
,
1
,
lineChange
.
originalEndLineNumber
,
Number
.
MAX_VALUE
),
options
:
{
className
:
'
line-delete
'
,
linesDecorationsClassName
:
'
my-deleted
'
,
isWholeLine
:
true
}
});
if
(
!
isChangeOrInsert
(
lineChange
)
||
!
lineChange
.
charChanges
)
{
result
.
decorations
.
push
(
createDecoration
(
lineChange
.
originalStartLineNumber
,
1
,
lineChange
.
originalEndLineNumber
,
Number
.
MAX_VALUE
,
'
char-delete
'
,
true
));
}
...
...
@@ -1553,7 +1563,14 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd
if
(
isChangeOrInsert
(
lineChange
))
{
result
.
decorations
.
push
(
createDecoration
(
lineChange
.
modifiedStartLineNumber
,
1
,
lineChange
.
modifiedEndLineNumber
,
Number
.
MAX_VALUE
,
'
line-insert
'
,
true
));
result
.
decorations
.
push
({
range
:
new
Range
(
lineChange
.
modifiedStartLineNumber
,
1
,
lineChange
.
modifiedEndLineNumber
,
Number
.
MAX_VALUE
),
options
:
{
className
:
'
line-insert
'
,
linesDecorationsClassName
:
'
my-added
'
,
isWholeLine
:
true
}
});
if
(
!
isChangeOrDelete
(
lineChange
)
||
!
lineChange
.
charChanges
)
{
result
.
decorations
.
push
(
createDecoration
(
lineChange
.
modifiedStartLineNumber
,
1
,
lineChange
.
modifiedEndLineNumber
,
Number
.
MAX_VALUE
,
'
char-insert
'
,
true
));
}
...
...
@@ -1699,7 +1716,14 @@ class DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditor
// Add decorations & overview zones
if
(
isChangeOrInsert
(
lineChange
))
{
result
.
decorations
.
push
(
createDecoration
(
lineChange
.
modifiedStartLineNumber
,
1
,
lineChange
.
modifiedEndLineNumber
,
Number
.
MAX_VALUE
,
'
line-insert
'
,
true
));
result
.
decorations
.
push
({
range
:
new
Range
(
lineChange
.
modifiedStartLineNumber
,
1
,
lineChange
.
modifiedEndLineNumber
,
Number
.
MAX_VALUE
),
options
:
{
className
:
'
line-insert
'
,
linesDecorationsClassName
:
'
my-added
'
,
isWholeLine
:
true
}
});
result
.
overviewZones
.
push
(
new
editorCommon
.
OverviewRulerZone
(
lineChange
.
modifiedStartLineNumber
,
...
...
@@ -1774,7 +1798,6 @@ class InlineViewZonesComputer extends ViewZonesComputer {
_produceModifiedFromDiff
(
lineChange
:
editorCommon
.
ILineChange
,
lineChangeOriginalLength
:
number
,
lineChangeModifiedLength
:
number
):
IMyViewZone
{
let
decorations
:
InlineDecoration
[]
=
[];
if
(
lineChange
.
charChanges
)
{
for
(
let
j
=
0
,
lengthJ
=
lineChange
.
charChanges
.
length
;
j
<
lengthJ
;
j
++
)
{
let
charChange
=
lineChange
.
charChanges
[
j
];
...
...
@@ -1788,8 +1811,16 @@ class InlineViewZonesComputer extends ViewZonesComputer {
}
let
html
:
string
[]
=
[];
let
marginHTML
:
string
[]
=
[];
let
lineDecorationsWidth
=
this
.
modifiedEditorConfiguration
.
layoutInfo
.
decorationsWidth
;
let
lineHeight
=
this
.
modifiedEditorConfiguration
.
lineHeight
;
for
(
let
lineNumber
=
lineChange
.
originalStartLineNumber
;
lineNumber
<=
lineChange
.
originalEndLineNumber
;
lineNumber
++
)
{
html
=
html
.
concat
(
this
.
renderOriginalLine
(
lineNumber
-
lineChange
.
originalStartLineNumber
,
this
.
originalModel
,
this
.
modifiedEditorConfiguration
,
this
.
modifiedEditorTabSize
,
lineNumber
,
decorations
));
let
index
=
lineNumber
-
lineChange
.
originalStartLineNumber
;
marginHTML
=
marginHTML
.
concat
([
`<div class="my-deleted" style="position:absolute;top:
${
index
*
lineHeight
}
px;width:
${
lineDecorationsWidth
}
px;height:
${
lineHeight
}
px;right:0;"></div>`
]);
}
let
domNode
=
document
.
createElement
(
'
div
'
);
...
...
@@ -1797,11 +1828,17 @@ class InlineViewZonesComputer extends ViewZonesComputer {
domNode
.
innerHTML
=
html
.
join
(
''
);
Configuration
.
applyFontInfoSlow
(
domNode
,
this
.
modifiedEditorConfiguration
.
fontInfo
);
let
marginDomNode
=
document
.
createElement
(
'
div
'
);
marginDomNode
.
className
=
'
inline-deleted-margin-view-zone
'
;
marginDomNode
.
innerHTML
=
marginHTML
.
join
(
''
);
Configuration
.
applyFontInfoSlow
(
marginDomNode
,
this
.
modifiedEditorConfiguration
.
fontInfo
);
return
{
shouldNotShrink
:
true
,
afterLineNumber
:
(
lineChange
.
modifiedEndLineNumber
===
0
?
lineChange
.
modifiedStartLineNumber
:
lineChange
.
modifiedStartLineNumber
-
1
),
heightInLines
:
lineChangeOriginalLength
,
domNode
:
domNode
domNode
:
domNode
,
marginDomNode
:
marginDomNode
};
}
...
...
src/vs/editor/browser/widget/media/addition.svg
0 → 100644
浏览文件 @
956de01b
<svg
width=
"16"
height=
"16"
xmlns=
"http://www.w3.org/2000/svg"
><title>
Layer 1
</title><rect
height=
"11"
width=
"3"
y=
"3"
x=
"7"
fill=
"#424242"
/><rect
height=
"3"
width=
"11"
y=
"7"
x=
"3"
fill=
"#424242"
/></svg>
\ No newline at end of file
src/vs/editor/browser/widget/media/deletion.svg
0 → 100644
浏览文件 @
956de01b
<svg
width=
"16"
height=
"16"
xmlns=
"http://www.w3.org/2000/svg"
><title>
Layer 1
</title><rect
height=
"3"
width=
"11"
y=
"7"
x=
"3"
fill=
"#424242"
/></svg>
\ No newline at end of file
src/vs/editor/browser/widget/media/diffEditor.css
浏览文件 @
956de01b
...
...
@@ -49,6 +49,22 @@
.monaco-editor
.char-insert
{
background
:
rgba
(
155
,
185
,
85
,
0.2
);
}
.my-added
,
.my-deleted
{
background-size
:
100%
;
background-repeat
:
no-repeat
;
background-position
:
0
;
}
.inline-deleted-margin-view-zone
{
text-align
:
right
;
}
.my-added
{
background-image
:
url('addition.svg')
;
}
.my-deleted
{
background-image
:
url('deletion.svg')
;
}
.monaco-editor.hc-black
.line-insert
,
.monaco-editor.hc-black
.char-insert
{
background
:
none
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录