Fixes #1249: Try harder to vertically center line numbers
This commit is contained in:
parent
083495a9fb
commit
50e49e3eef
2 changed files with 12 additions and 2 deletions
|
@ -2,8 +2,17 @@
|
|||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.monaco-editor .margin-view-overlays .line-numbers {
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
cursor: url('./flipped-cursor.svg') 12.6 0, default;
|
||||
}
|
||||
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.monaco-editor .margin-view-overlays .line-numbers.lh-odd {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
|
|
@ -98,11 +98,12 @@ export class LineNumbersOverlay extends ViewEventHandler implements EditorBrowse
|
|||
|
||||
var output: IRenderResult = {};
|
||||
|
||||
var lineHeightClassName = (this._context.configuration.editor.lineHeight % 2 === 0 ? ' lh-even': ' lh-odd')
|
||||
var lineHeight = this._context.configuration.editor.lineHeight.toString(),
|
||||
lineNumber:number,
|
||||
renderLineNumber:string;
|
||||
|
||||
var common = '<div class="' + EditorBrowser.ClassNames.LINE_NUMBERS + '" style="left:' + this._lineNumbersLeft.toString() + 'px;width:' + this._lineNumbersWidth.toString() + 'px;height:' + lineHeight + 'px;">';
|
||||
var common = '<div class="' + EditorBrowser.ClassNames.LINE_NUMBERS + lineHeightClassName + '" style="left:' + this._lineNumbersLeft.toString() + 'px;width:' + this._lineNumbersWidth.toString() + 'px;height:' + lineHeight + 'px;">';
|
||||
|
||||
for (lineNumber = ctx.visibleRange.startLineNumber; lineNumber <= ctx.visibleRange.endLineNumber; lineNumber++) {
|
||||
renderLineNumber = this._context.model.getLineRenderLineNumber(lineNumber);
|
||||
|
|
Loading…
Reference in a new issue