提交 64005b74 编写于 作者: P Peng Lyu

resolve conflicts for folding, git and comment in glyph

上级 897bdf7b
......@@ -332,10 +332,13 @@ export class FoldingController implements IEditorContribution {
switch (e.target.type) {
case MouseTargetType.GUTTER_LINE_DECORATIONS:
const data = e.target.detail as IMarginData;
const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
const offsetLeftInGutter = (e.target.element as HTMLElement).offsetLeft;
const gutterOffsetX = data.offsetX - offsetLeftInGutter;
// const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
// TODO@joao TODO@alex TODO@martin this is such that we don't collide with dirty diff
if (gutterOffsetX <= 10) {
if (gutterOffsetX < 10) {
return;
}
......
......@@ -523,7 +523,7 @@ export class ReviewZoneWidget extends ZoneWidget {
const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
// don't collide with folding and git decorations
if (gutterOffsetX < 10 && gutterOffsetX > 19) {
if (gutterOffsetX > 14) {
return;
}
......
......@@ -102,7 +102,7 @@ class CommentingRangeDecorator {
isWholeLine: true,
};
decorationOptions.linesDecorationsClassName = `comment-dirty-diff-glyph ${className}`;
decorationOptions.linesDecorationsClassName = `comment-range-glyph ${className}`;
return ModelDecorationOptions.createDynamic(decorationOptions);
}
......@@ -423,7 +423,7 @@ export class ReviewController implements IEditorContribution {
const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
// don't collide with folding and git decorations
if (gutterOffsetX < 10 && gutterOffsetX > 19) {
if (gutterOffsetX > 14) {
return;
}
......
......@@ -241,12 +241,14 @@
position: relative;
}
.monaco-editor .comment-dirty-diff-glyph {
margin-left: 14px;
.monaco-editor .comment-range-glyph {
margin-left: 5px;
width: 4px !important;
cursor: pointer;
z-index: 10;
}
.monaco-editor .comment-dirty-diff-glyph:before {
.monaco-editor .comment-range-glyph:before {
position: absolute;
content: '';
height: 100%;
......@@ -255,7 +257,7 @@
transition: width 80ms linear, left 80ms linear;
}
.monaco-editor .margin-view-overlays>div:hover>.comment-dirty-diff-glyph.comment-diff-added:before {
.monaco-editor .margin-view-overlays>div:hover>.comment-range-glyph.comment-diff-added:before {
position: absolute;
content: '+';
height: 100%;
......@@ -265,7 +267,11 @@
color: black;
}
.monaco-editor .comment-dirty-diff-glyph.comment-thread:before {
.monaco-editor .comment-range-glyph.comment-thread {
z-index: 20;
}
.monaco-editor .comment-range-glyph.comment-thread:before {
position: absolute;
content: '·';
height: 100%;
......@@ -277,4 +283,8 @@
.monaco-editor.inline-comment .margin-view-overlays .folding {
margin-left: 14px;
}
\ No newline at end of file
}
.monaco-editor.inline-comment .margin-view-overlays .dirty-diff-glyph {
margin-left: 14px;
}
......@@ -703,11 +703,16 @@ export class DirtyDiffController implements IEditorContribution {
return;
}
if (e.target.element.className.indexOf('dirty-diff-glyph') < 0) {
return;
}
const data = e.target.detail as IMarginData;
const gutterOffsetX = data.offsetX - data.glyphMarginWidth - data.lineNumbersWidth - data.glyphMarginLeft;
const offsetLeftInGutter = (e.target.element as HTMLElement).offsetLeft;
const gutterOffsetX = data.offsetX - offsetLeftInGutter;
// TODO@joao TODO@alex TODO@martin this is such that we don't collide with folding
if (gutterOffsetX > 10) {
if (gutterOffsetX < 0 || gutterOffsetX > 10) {
return;
}
......
......@@ -6,6 +6,7 @@
.monaco-editor .dirty-diff-glyph {
margin-left: 5px;
cursor: pointer;
z-index: 5;
}
.monaco-editor .dirty-diff-deleted:after {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册