提交 46a1e1d9 编写于 作者: P Peng Lyu

Fix #44639. RenderLineHighlight should not affect active line number color.

上级 66aa34ba
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .margin-view-overlays .current-line-margin {
.monaco-editor .margin-view-overlays .current-line {
display: block;
position: absolute;
left: 0;
......@@ -11,6 +11,6 @@
box-sizing: border-box;
}
.monaco-editor .margin-view-overlays .current-line-margin.current-line-margin-both {
.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both {
border-right: 0;
}
\ No newline at end of file
......@@ -91,21 +91,21 @@ export class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay {
public render(startLineNumber: number, lineNumber: number): string {
if (lineNumber === this._primaryCursorLineNumber) {
let className = 'current-line';
if (this._shouldShowCurrentLine()) {
const paintedInContent = this._willRenderContentCurrentLine();
const className = 'current-line-margin' + (paintedInContent ? ' current-line-margin-both' : '');
return (
'<div class="'
+ className
+ '" style="width:'
+ String(this._contentLeft)
+ 'px; height:'
+ String(this._lineHeight)
+ 'px;"></div>'
);
} else {
return '';
className = 'current-line current-line-margin' + (paintedInContent ? ' current-line-margin-both' : '');
}
return (
'<div class="'
+ className
+ '" style="width:'
+ String(this._contentLeft)
+ 'px; height:'
+ String(this._lineHeight)
+ 'px;"></div>'
);
}
return '';
}
......
......@@ -177,6 +177,6 @@ registerThemingParticipant((theme, collector) => {
}
const activeLineNumber = theme.getColor(editorActiveLineNumber);
if (activeLineNumber) {
collector.addRule(`.monaco-editor .current-line-margin ~ .line-numbers { color: ${activeLineNumber}; }`);
collector.addRule(`.monaco-editor .current-line ~ .line-numbers { color: ${activeLineNumber}; }`);
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册